【问题标题】:Error with trailing slashes尾部斜杠错误
【发布时间】:2012-01-06 17:28:06
【问题描述】:

我有一个 Wordpress 网站,例如我想要这个 URL:

http://mywebsite.com/tag/hola

自动重定向到

http://mywebsite.com/tag/hola/

问题是我不能把斜杠放在那里。有人可以帮我吗?我可以用我的 htaccess 做些什么来自动重定向它吗?非常感谢!

【问题讨论】:

  • 发布您的永久链接结构。谢谢

标签: wordpress .htaccess slash trailing


【解决方案1】:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]

【讨论】:

    猜你喜欢
    • 2017-08-09
    • 1970-01-01
    • 2011-12-09
    • 2013-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多