具有任何utf8字符的Mod_rewrite

时间:2011-10-19 04:24:35

标签: apache mod-rewrite utf-8

我需要使用以下格式的链接: http://site.com/index (或/ index-blahblah或/ index1或/ index1-blahblah)

其中blahblah可以包含任何UTF 8字符

我在下面编写了规则,但它不起作用....请帮忙!

AddDefaultCharset UTF-8 
RewriteRule ^/?(index|index1)-?(.*)$ main.php?page=$1&keyword=$2 [NC,B,L]

如果我放置一个范围,它确实有效......但不是'。'

RewriteRule ^/?(index|index1)-*([A-Z]*)$ main.php?page=$1&keyword=$2 [NC,B,L]

1 个答案:

答案 0 :(得分:-1)

domain.com/category-name/to domain.com/categories.php?name=category-name

RewriteRule ^([A-Za-z0-9 - ] +)/?$ categories.php?name = $ 1 [L]

我认为这个例子可能有所帮助。