-3

I am new to .htaccess and I want apply .htaccess rule to tags page. The actual page which I am using for tags is tagsearch. Here is my rule

RewriteRule tags/([a-z|A-Z|0-9]+)/$ tagsearch.php?tag=$1 

Please advise.

4

1 回答 1

1

在正则表达式字符集中,|不是“或”符号,而是文字字符|

您是否可能遗漏了目标 URL 中的初始斜杠/,并希望将尾部斜杠设为可选?

尝试这个:

RewriteRule ^/tags/([a-zA-Z0-9]+)/?$ /tagsearch.php?tag=$1

尝试启用日志记录。有一个“RewriteLog”语句用于调试重写问题。

于 2012-11-05T07:28:40.973 回答