質問

I would like to rewrite my url as the following:

http://test.com/listing?p=2 

to

http://test.com/listing/p/2

Any solutions, please kindly to help me.

役に立ちましたか?

解決

Place this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteRule ^listing/(\w+)/(\d+)/?$ /listing/?$1=$2 [L,QSA,NC]
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top