簡體   English   中英

我如何從.htaccess重寫此字符串

[英]How can i rewrite this string from .htaccess

我已經搜索了這個問題,但是我只遇到了真正難以回答的特定答案,這些答案似乎很難滿足我的特定需求。

如何重寫URL?

現在我有了這樣的URL: automv.ro/anunturi-auto/?make=bmw ,我想使其看起來像這樣automv.ro/anunturi-auto/bmw

我已經嘗試過了,但是沒有用:

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

請嘗試以下操作:

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]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM