url重写htaccess问题

我有网址:

http://127.0.0.1/myfolder/index.php

http://127.0.0.1/myfolder/index.php?error=1 ...

我该怎么做

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] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章