如何添加网址的最后一部分?

时间:2019-05-15 12:46:50

标签: regex mod-rewrite

应该有一种不重定向到URL并在其后添加一些URL的方法。

我使用正则表达式工具进行了尝试,并不同了StackOverflow的答案。

<IfModule mod_rewrite.c>
#For the Set
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
#RewriteRule    ^set\/([0-9]*)\/.*   ./index.php?setId=$1 [NC,L]
RewriteRule    ^set\/([0-9]*)\/(.*)   ./index.php/set/$1?setId=$1 [NC,L]
RewriteRule    ^sets\/page\/([0-9]+).*    ./index.php?page=$1 [NC,L]
</IfModule>

基本网址是:

https://mypage.com/set/[Number]/this-is-a-great-set

它应该使用index.php / set / $?i / this-is-a-great-set /?setId = $ 1

因此,在第一个重写规则上应该有第二个捕获页面名称的组。...=>这是一个很棒的集合

目标是: https://mypage.com/set/[Number]/this-is-a-great-set 该URL看起来仍然与上面的示例相似,但已加载 index.php / set?setId = [Number]

0 个答案:

没有答案