1

xampp を使用してローカルに Web サイトを持っており、この URLlocalhost/mysite/frontend/article.php?article_id=somethingをに変換したいと考えてlocalhost/mysite/frontend/article_id/somethingいます。この書き換えルールを使用します。

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

しかし、正しくありません。誰かが正しいことを手伝ってくれませんか。ありがとう。

4

2 に答える 2

0

これを試して:

RewriteBase /mysite/frontend/
RewriteRule ^([A-Za-z0-9-]+)(/(.*?))?/?$ article.php?$1=$3 [L]
于 2012-09-09T19:03:21.660 に答える
0

http の場合: //localhost/mysite/frontend/article_id/something .htaccess が mysite ディレクトリにあり、何かが無視される場合

RewriteRule ^frontend/([^/]+)/ /mysite/frontend/article.php?article_id=$1 [L] 
于 2012-09-09T17:03:30.417 に答える