我有两种URL:
- http://www.mydomain.com/Admin/Cpanel
- http://www.mydomain/Admin/shared/css/somestyle.css
1是对index.php的命令,2是一个实际文件
我需要mod_rewrite请求1/MyApp/index.php我需要mod_rewrite请求2/MyApp/shared/css/somestyle.css
在/
我有一个.htaccess
文件与RewriteEngine On
RewriteCond ^MyApp/%{REQUEST_FILENAME} -f
RewriteRule ^MyApp/([^/]*)/(.*)?$ /MyApp/$1/$2 [L,QSA]
RewriteCond ^MyApp/%{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*)/?$ /MyApp/index.php [L,QSA]
mod_rewrite似乎进入了一个循环。
我相信答案很简单,但是我一天之后…我还是不明白我哪里做错了试试这个:
RewriteEngine On
RewriteRule ^/Admin/Cpanel$ /MyApp/index.php [L]
RewriteRule ^/Admin/(.*)$ /MyApp/$1