简体   繁体   中英

How can i rewrite this string from .htaccess

I've searched for this question but I only come across really specific answers that seem difficult to tailor to my specific needs.

How can I rewrite the URL's?

Now I have the URL like this: automv.ro/anunturi-auto/?make=bmw and I want to make it look like this automv.ro/anunturi-auto/bmw

I have tried with this but doesn't work:

RewriteRule ^anunturi-auto/?make= anunturi-auto/$1 [L] 
RewriteCond %{QUERY_STRING} .
RewriteRule (.*) $1?

Try the following:

RewriteEngine On

RewriteCond %{THE_REQUEST} /(anunturi-auto)/\?make=(bmw) [NC]
RewriteRule ^anunturi-auto/?$ /%1/%2? [R=301,L]

RewriteRule ^(anunturi-auto)/([^/]+)/?$ /$1?make=$2 [L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM