2016-11-16 18 views
-1

簡単な質問(希望)。 私は、URLからクエリを削除し、文字列だけを保持して書き直す必要があります。mod_rewriteがクエリを削除して文字列を保持する

例:

http://example.com/photography/?c=events 

そして、最終的な結果は次のようになります。

http://example.com/photography/events 
+0

[参照:mod \ _rewrite、URLの書き換え、および「pretty links」の説明の可能な複製](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links - 説明される) – Croises

答えて

0

何について:

RewriteEngine on 

# capture the value of c parameter of the query string (as %1) 
RewriteCond %{QUERY_STRING} (?:^|&)c=([^&]+) 
RewriteRule ^photography/$ $0%1? [L] 

関連する問題