Mod rewrite 本地主机中的mod_重写帮助

Mod rewrite 本地主机中的mod_重写帮助,mod-rewrite,xampp,localhost,Mod Rewrite,Xampp,Localhost,我有一个带有xampp的本地网站,我想将这个url localhost/mysite/frontend/article.php?article_id=something转换为localhost/mysite/frontend/article_id/something。我使用这个重写规则 RewriteRule ^([A-Za-z0-9-]+)/?$ article.php?article_id=$1 [L] 但是不正确。有人能帮个忙吗?谢谢。查看http://localhost/mysite

我有一个带有xampp的本地网站,我想将这个url localhost/mysite/frontend/article.php?article_id=something转换为localhost/mysite/frontend/article_id/something。我使用这个重写规则

RewriteRule ^([A-Za-z0-9-]+)/?$ article.php?article_id=$1 [L] 

但是不正确。有人能帮个忙吗?谢谢。

查看http://localhost/mysite/frontend/article\u id/something,如果.htaccess在mysite目录中,有些内容被忽略了

RewriteRule ^frontend/([^/]+)/ /mysite/frontend/article.php?article_id=$1 [L] 
试试这个:

RewriteBase /mysite/frontend/
RewriteRule ^([A-Za-z0-9-]+)(/(.*?))?/?$ article.php?$1=$3 [L]

.htaccess是指向前端目录的,此规则不适用于^frontend。如果.htaccess位于前端目录中,请使用RewriteRule^[^/]+///mysite/frontend/article.php?article_id=$1[L]