2017-01-24 39 views
0

複数のパラメータを使用してURL書き換えに関する多くの質問を読みました。しかし、私はまだこの問題を修正することはできません。複数の設定されていないクエリパラメータがあるURLを書き換えます.htaccess

私は複数のパラメータ、値
http://localhost:8888/coches/index.php?maker=all&model=&registration_year=&price_until=&tfseekfid=main_search&s=~

のないそれらのいくつかと、このURLを持っている私は、このルールを試してみましたhttp://localhost:8888/coches/all-cars

にそれを書き換えたいですいくつかの他のものは動作させることができません。

RewriteRule ^all-cars$ /index.php?maker=all&model=&registration_year=&price_until=&tfseekfid=main_search&s=~ [L,QSA] 

誰でも手助けできますか?ありがとう

答えて

0

このルールを含む.htaccessファイルの場所は重要です。サブディレクトリには.htaccess個のファイルがあります。

.htaccessファイルは、あなたのルールでディレクトリを指定する必要があり、あなたのドキュメントルート内にある場合:

<IfModule mod_rewrite.c> 
RewriteEngine on 

RewriteRule ^coches/all-cars$ /coches/index.php?maker=all&model=&registration_year=&price_until=&tfseekfid=main_search&s=~ [L,QSA] 
</IfModule> 

ファイルが/coches/.htaccessある場合は、サブにそれは相対作るためにあなたのルールから先頭/を削除ディレクトリ:

<IfModule mod_rewrite.c> 
RewriteEngine on 

RewriteRule ^all-cars$ index.php?maker=all&model=&registration_year=&price_until=&tfseekfid=main_search&s=~ [L,QSA] 
</IfModule> 
+0

ご回答ありがとうございます。私のパスは/coches/.htaccess 残念ながらあなたの提案はどちらも試みたことがありません – Santos

+0

@サントス、Apacheで 'mod_rewrite'を有効にしていますか? – labue

+0

はい、Apacheリライトが有効になっています – Santos

関連する問題