将对别名的所有调用重定向到同一别名的子文件夹中的一页
Redirect all calls to alias to one page in sub folder on same alias
我在 wamp 服务器上创建 htaccess 文件时遇到问题。
我希望对本地主机服务器上的别名(虚拟文件夹)的所有调用都重定向到同一别名上的 public 文件夹。
例如我想
http://localhost/test/***/ or http://localhost/test/***/***/***/
重定向到
http://localhost/test/public/indes.php?a=******.
我找到了很多示例,但没有一个不能正常工作,我收到错误 "The page isn't redirecting properly" 或“500 内部服务器错误”。
这是我的 htaccess 示例文件:
RewriteEngine on
RewriteBase /test
RewriteRule ^(.*)$ http://localhost/test/public/index.php [R=301,L]
谁能告诉我哪里错了?
预先感谢您的回复。
我试试看:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /test/public/index.php
我在 wamp 服务器上创建 htaccess 文件时遇到问题。
我希望对本地主机服务器上的别名(虚拟文件夹)的所有调用都重定向到同一别名上的 public 文件夹。
例如我想
http://localhost/test/***/ or http://localhost/test/***/***/***/
重定向到
http://localhost/test/public/indes.php?a=******.
我找到了很多示例,但没有一个不能正常工作,我收到错误 "The page isn't redirecting properly" 或“500 内部服务器错误”。
这是我的 htaccess 示例文件:
RewriteEngine on
RewriteBase /test
RewriteRule ^(.*)$ http://localhost/test/public/index.php [R=301,L]
谁能告诉我哪里错了?
预先感谢您的回复。
我试试看:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /test/public/index.php