我有这样的网址结构:
http://domain.com/en/test/?page=2
http://domain.com/smth/en/test/;sysmod/dashboard/?page=2
我想重写这样的网址:
http://domain.com/?var1=en/test/?page=2
http://domain.com/?var1=smth/en/test/&var2=sysmod/dashboard/?page=2
因为我想在php脚本中使用$ _GET方法来获取var1和var2变量。
我自己的htaccess代码如下:
RewriteRule ^(.*);(.*)$ index.php?var1=$1&var2=$2 [L,QSA]<br/>
RewriteRule ^(.*)$ index.php?var1=$1 [L,QSA]
这看起来有效但是......即使添加
,css或js脚本也没有加载到页面中
RewriteCond %{REQUEST_URI}
对于css / js文件夹。
谢谢!
答案 0 :(得分:1)
感谢巴拿马杰克,
但我几分钟前就开始工作了。我做了什么:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*);(.*)$ index.php?var1=$1&var2=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?var1=$1 [L,QSA]