所以我有以下文件夾結構:的.htaccess重寫文件夾發行
-public_html/
- .htaccess
- web/
- index.php
- rt/
-index.php
的的.htaccess包含以下內容:
RewriteEngine On
RewriteRule ^rt/(.*)$ web/rt/$1 [NC,QSA,L]
RewriteRule ^(.*)$ web/$1 [NC,QSA,L]
的想法是,開始「RT」的任何URL定向到'web/rt'(例如/ rt /和/ rt/secure /)以及其他所有內容都轉到'web'。出於某種原因,'rt'重定向不起作用,一切都將'網絡'。任何幫助是極大的讚賞。
例子:
/ > web/index.php
/my_page/ > web/index.php
/rt/ > web/rt/index.php
/rt/another_page/ > web/rt/index.php
感謝賈斯汀,但加入'RewriteBase /'確實奏效。 – Paul