我試圖改寫這樣的文件夾中的所有請求:重寫所有的請求到一個文件夾.htaccess文件
http://www.test.com/banana/banana(或其他)去http://www.test.com/public但在URL仍然http://www.test.com/banana/banana。
我該怎麼做?
廠家批號
我試圖改寫這樣的文件夾中的所有請求:重寫所有的請求到一個文件夾.htaccess文件
http://www.test.com/banana/banana(或其他)去http://www.test.com/public但在URL仍然http://www.test.com/banana/banana。
我該怎麼做?
廠家批號
裏面那個特定的文件夾您可以創建的.htaccess這個規則:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule^/public/ [L]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /public/index.php [NC,L,QSA]
這.htaccess
將改寫爲/public/index.php
所有請求。現有文件和目錄仍將提供。