我有网址:
我该怎么做
http://127.0.0.1/rewritedpath/ (index.php)
http://127.0.0.1/rewritedpath/error/1 (index.php?error=1)
我已经试过了
RewriteEngine on
RewriteRule ^/?rewritedpath/ /myfolder/index.php
RewriteRule ^/?rewritedpath/error/([0-9]+)$ /myfolder/index.php?error=$1
但这是行不通的。这里有什么问题?谢谢
更新
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?rewritedpath/error/([0-9]+)$ /myfolder/index.php?error=$1 [L]
RewriteRule ^/?rewritedpath/ /myfolder/index.php [L]
试试下面的规则,
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?rewritedpath/ /myfolder/index.php [L]
RewriteRule ^/?rewritedpath/error/([0-9]+)$ /myfolder/index.php?error=$1 [L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句