我想从http://www.domain.com/customer1 to /app/index.php?c=customer1
和http://www.domain.com/customer2 to /app/index.php?c=customer2
我尝试了以下规则,但效果不佳......
RewriteRule ^customer1(.*)$ /app/index.php?c=customer1
答案 0 :(得分:0)
我假设你在谈论重写,
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)$ /app/index.php?c=$1 [QSA,L]
如果没有重写,这将在内部重写您的网址,然后尝试这样做,
RewriteEngine on
RerwiteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)$ /app/index.php?c=$1 [R=301,QSA,L]