htaccess的更换空间的网址和重定向重定向、网址、空间、htaccess

由网友(寄望山河的信)分享简介:我是新手,想解决的一个问题。我读了同样的问题,但误解:I am newbie and want to solve a problem.I read same question but misunderstand:htaccess的重定向URL与它的空间 请帮助我。我的网站用字preSS与自定义字段和标签。P...

我是新手,想解决的一个问题。 我读了同样的问题,但误解:

I am newbie and want to solve a problem. I read same question but misunderstand:

htaccess的重定向URL与它的空间

请帮助我。 我的网站用字preSS与自定义字段和标签。

Please help me. My site use wordpress with custom fields and tags.

自定义字段让很多环节,如:

Custom Fields make lot of link such as:

http://domain.com/tag/Miss Earth
http://domain.com/tag/Miss World
http://domain.com/tag/Miss England
...

(空间不是20%) 五言的,我也创建标签:地球小姐,世界小姐,英国小姐......但上面的链接不存在(空格(),必须改为 - 和M的M和E由E......

(Space not %20) Of cource I also create tags: Miss Earth, Miss World, Miss England... but above links are not exist (space (" ") must be replaced by "-" and "M" by "m" and "E" by "e"...

我需要使用htaccess的更换空间()字符为 - ,并自动重定向到真正的标签:

I need use htaccess to replace space (" ") character to "-" and auto redirect to really tags:

http://domain.com/tag/miss-earth
http://domain.com/tag/miss-world
http://domain.com/tag/miss-england

请帮我清楚了,我笨与htaccess的。

Please help me clearly, I am stupid with htaccess.

感谢

推荐答案

尝试在你的文档根目录下添加这些规则的htaccess文件,preferably高于已经在文件中的任何字preSS的规则:

Try adding these rules to the htaccess file in your document root, preferably above any wordpress rules that are already in the file:

RewriteEngine On
RewriteRule ^/?tag/(.*) (.*)$ /tag/$1-$2   [L,R=301]
阅读全文

相关推荐

最新文章