[英]CodeIgniter URL rewrite - but not on the XAMPP directory
我想從CodeIgniter服務的所有頁面中取出index.php
但我希望仍然能夠照常訪問XAMPP文件夾中的所有內容。
這是我的目錄結構:
htdocs\
.\Application\
.\XAMPP\
我的.htaccess
文件:
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.html$ $1.php [L]
因此,我希望能夠以http:\\\\localhost\\controller\\method\\arg
而不是http:\\\\localhost\\index.php\\controller\\method\\arg
看到我的應用程序。
但是我還希望能夠看到http:\\\\localhost\\XAMPP\\index.php
-XAMPP像MySQL一樣具有我的控制面板,並且我無法將其.htaccess
文件放在適當的位置(因為它會重寫為http:\\\\localhost\\XAMPP\\
而不是http:\\\\localhost\\XAMPP\\index.php
)。
這可能嗎,我該怎么辦?
如果我很好理解您的問題,只需使用指令RewriteEngine off
將.htaccess文件放入XAMPP目錄。 它應該工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.