I am trying to rewrite url with htaccess from
https://www.example.com/cozumel/...
to
https://www.example.com/cozumel-shore-excursions/...
I tried like this
RewriteEngine On
RewriteRule ^/cozumel\/(.*) /cozumel-shore-excursions/$1 [L,R=301]
尝试使用此行:
RewriteRule ^cozumel/$ /cozumel-shore-excursions/?&%{QUERY_STRING}
just remove the leading slash from your rule's pattern :
RewriteEngine On
RewriteRule ^cozumel/(.*) /cozumel-shore-excursions/$1 [L,R=301]
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.