Rewrite dynamic url structure with .hataccess

后端 未结 3 1369
轮回少年
轮回少年 2021-01-24 23:07

I\'ve tried to rewrite the dynamic URL (below) to a slightly different structure; either does not work or I am not sure if it is correct:

  • Old URL (URL#1): index.ph
3条回答
  •  遇见更好的自我
    2021-01-24 23:16

    Here is the code that worked (first step), from faa:

    Options +FollowSymlinks -MultiViews
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{QUERY_STRING} lang=([^&]+)&zone=([^&]+)&city=([^&]+)&str=([^&]+)&search=  [NC]
    RewriteRule .* /index.php?lang=%1&country=%2&place=%3&street=%4 [L,NC]
    

提交回复
热议问题