简体   繁体   English

WordPress的永久链接与斜杠给404

[英]Wordpress permalink with trailing slash give 404

I have the wordpress on this url: 我在这个网址上有wordpress:

http://www.website.com/blog/

If I try to open any post the url only work as: 如果我尝试打开任何帖子,则该网址仅适用于:

http://www.website.com/blog/%postname%

When I try to put trailing slash at the end it give error 404. 当我尝试在末尾添加斜杠时,出现错误404。

http://www.website.com/blog/%postname%/

This is my .htaccess 这是我的.htaccess

IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

也许您可以尝试重新生成永久链接并在Wordpress设置中设置自定义结构。

http://www.website.com/%category%/%postname%/

I found the error: 我发现了错误:

It was URlScan It was blocking my Urls because some of them contain dots. 这是URlScan,它阻止了我的Urls,因为其中一些包含点。

example: http://website.com/blog/test-3.0/style/foo.css 示例: http://website.com/blog/test-3.0/style/foo.csshttp://website.com/blog/test-3.0/style/foo.css

I opened up the UrlScan.ini file located: 我打开了位于以下位置的UrlScan.ini文件:

%windir%\system32\inetsrv\urlscan\UrlScan.ini

And changed AllowDotInPath=0 to AllowDotInPath=1 并将AllowDotInPath = 0更改为AllowDotInPath = 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM