[英]url rewrite rule for paramters
I have the following URL:我有以下 URL:
https://www.mydomain.de/termin_cancel=c502b486-e8ad-490a-a615-80307a515fc8
Original url:原url:
https://www.mydomain.de/index.php?termin_cancel=c502b486-e8ad-490a-a615-80307a515fc8
rewrite rule:重写规则:
RewriteRule ^termin_cancel=([\w-]+)/?$ index.php?termin_cancel=$1 [L,NC,QSA]
This works !这行得通!
But now I have a problem with the next situation:但是现在我对下一种情况有疑问:
The url should be: url 应该是:
https://www.mydomain.de/termin_change=XXX&serviceID=XXX&firstname=XXX&lastname=XXX&email=XXX
original url:原url:
https://www.mydomain.de/index.php?termin_change=XXX&serviceID=XXX&firstname=XXX&lastname=XXX&email=XXX
I don't know which.htaccess rule work fo this.我不知道 which.htaccess 规则适用于此。 It should be possible to access the parameters via php
$_GET
.应该可以通过 php
$_GET
访问参数。
Could you please try following.能否请您尝试以下。
RewriteEngine ON
RewriteRule ^(.*) index.php?$1 [QSA,NE,L]
OR with /
in case your index.php is present in root directory/folder.或与
/
以防您的 index.php 存在于根目录/文件夹中。
RewriteEngine ON
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*) /index.php?$1 [QSA,NE,L]
OR(either put above or put following)或(放在上面或放在下面)
RewriteEngine ON
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{REQUEST_URI} ^/termin_change=.*/?$ [NC]
RewriteRule ^(.*) /index.php?$1 [QSA,NE,L]
This should work for you.这应该适合你。
RewriteRule ^termin_change=([^&]+)&serviceID=([^&]+)&firstname=([^&]+)&lastname=([^&]+)&email=([^&]+)$ /index.php?termin_change=$1&serviceID=$2&firstname=$3&lastname=$4&email=$5 [L,NC]
Try, something like below specifically for termin_change=
试试,像下面这样专门针对
termin_change=
RewriteRule ^termin_change=(.+)/?$ index.php?termin_change=$1 [L,NC,QSA]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.