2017-04-01 15 views
0

htaccessルールを作成しましたが、それは動作しません。 は、ここに私のurlここ私のhtaccessルールが機能しない理由

http://localhost/mat/site/brandlisting/21/page/2 

それ

RewriteRule brandlisting/(.*)(.*)/page/(.*) site/brandlisting?id=$1&page=$2 [L] 
RewriteRule brandlisting/(.*)(.*)/page site/brandlisting?id=$1&page=$2 [L] 

RewriteRule brandlisting/(.*)/ site/brandlisting?id=$1 [L] 
RewriteRule brandlisting/(.*) site/brandlisting?id=$1 [L] 
RewriteRule site/brandlisting/(.*)/?$ site/brandlisting?id=$1 [L] 

のための私のhtaccess規則が何か問題があるとされているのですか? 私のhtaccessルールにはどんなミスがありますか?

答えて

0

あなたは、シングルヒットですべてのものと一致するワイルドカードグリーディパターンの正規表現を使用しています。以下のルールを使用します。サイトフォルダ内で.htaccessを使用していると仮定しています。

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^brandlisting/([\d]+)/page/([\d]+)$ brandlisting?id=$1&page=$2 [L] 
RewriteRule ^brandlisting/([\d]+)/?$ brandlisting?id=$1 [L] 
RewriteRule ^site/brandlisting/([\d]+)/?$ brandlisting?id=$1 [L] 
+0

です。ありがとう –

関連する問題