简体   繁体   English

更新WP和.htaccess中的永久链接会杀死非WP子页面

[英]Updating permalinks in WP and .htaccess killed the non-WP subpages

Update: Woops, realized I put the code in the wrong folder. 更新:糟糕,意识到我将代码放在错误的文件夹中。 The root not the /blog/ 根目录不是/ blog /

Client is running an old version of wordpress, around 1.7 or 1.8ish. 客户端运行的Wordpress的旧版本约为1.7或1.8ish。

The Blog is at: 该博客位于:

site.com/blog/ site.com/blog/

The link format was like this: 链接格式如下:

http://www.site.com/blog/?p=1276 http://www.site.com/blog/?p=1276

And I had selected to change the format to have titles based on keywords from the title: 而且我已经选择更改格式,以根据标题中的关键字添加标题:

http://www.site.com/blog/keyword1-keywords2-...-keywordX/ http://www.site.com/blog/keyword1-keywords2-...-keywordX/

I then updated my .htaccess with this code generated: 然后,我使用生成的代码更新了.htaccess:

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

The result was that the subpages on the site.com that were not in the blog folder were unreachable. 结果是site.com上不在博客文件夹中的子页面无法访问。 (the main page was reachable, and the blog did work fine with the new URLs, it just messed up the rest of the site) (可以访问主页,并且博客可以很好地使用新的URL,只是弄乱了网站的其余部分)

Anyone have any ideas on why this might have disrupted the rest of the site and any changes I can make to the code? 有人对为什么这可能会干扰网站的其余部分以及我可以对代码进行的任何更改有任何想法吗?

Update: Woops, realized I put the code in the wrong folder. 更新:糟糕,意识到我将代码放在错误的文件夹中。 The root not the /blog/ 根目录不是/ blog /

我遇到了类似的问题,我要做的是转到每个页面并发布(在更新了永久链接结构之后),并更新每个页面,以便创建一个新的URL。

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

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