Menu Home

worldpress使用固定链接

OS: ubuntu 12.10

WordPress:  3.5.1

        最近看了一下SEO,决定把网站改称/%year%/%monthnum%/%day%/%postname%/格式的固定链接,改完之后,所有页面都报了404错误,通过下面的步骤,问题排除:


wordpress –> 设置 –> 固定链接 , 在打开的页面中选择你希望使用的固定链接格式。点击保持时如果出现 .htaccess 不能访问的提示,则需要检查.htaccess文件。进入到你主机的网站目录,查看是否有.htaccess,没有则创建;有,检查文件的权限。这一步都正确后如果还是有问题,检查apache2的设置,ubuntu 12.10上apache2的配置文件在/etc/apache2/下打开/etc/apache2/site-enable/下的000-default(在我主机上只有这个文件),把里面的“AllowOverride None” 改成 “AllowOverride All” 。进入/etc/apace2/mods-enabled/目录,检查是否存在rewrite.load文件,如果没有,检查下面3项:

  1. 检查rewrite模块在系统是否存在: find /usr/lib/  -name “*rewrite*” 
  2. 检查apache是否load rewrite模块 :/etc/apache2/mods-available/rewrite.load 里内容没有被“#”注释
  3. 手工加载rewrite模块:  sudo a2enmod rewrite , 按提示重启apache2,这时候再查看/etc/apace2/mods-enabled/目录,应该有rewrite.load文件了。

最后重启apache: service apache2 restart , 所有页面都可以访问。

14 replies

  1. I wanted to post a brief message in order to thank you for these magnificent secrets you are giving here. My extended internet search has at the end of the day been recognized with useful points to talk about with my family members. I would assume that we visitors are definitely endowed to be in a wonderful place with so many brilliant professionals with very helpful tips and hints. I feel very much blessed to have encountered your entire weblog and look forward to really more entertaining minutes reading here. Thank you again for everything.

  2. Thanks a lot for providing individuals with such a pleasant possiblity to check tips from here. It is usually very brilliant and full of fun for me personally and my office mates to search your web site the equivalent of thrice in 7 days to see the fresh stuff you will have. Of course, I’m so always astounded with your powerful tactics served by you. Certain 1 points in this article are undoubtedly the very best we have all had.

  3. My wife and i got absolutely joyful that Albert could finish off his investigation through your precious recommendations he was given through the web pages. It’s not at all simplistic to simply choose to be giving freely hints that people may have been trying to sell. And now we understand we’ve got the writer to be grateful to because of that. The illustrations you have made, the easy web site navigation, the relationships you help instill – it’s all exceptional, and it is making our son and our family know that this theme is amusing, and that is highly indispensable. Many thanks for the whole lot!

  4. Thank you a lot for providing individuals with remarkably breathtaking opportunity to discover important secrets from here. It is usually so pleasurable plus stuffed with fun for me personally and my office peers to visit your site at minimum thrice in one week to read the new guidance you have got. And indeed, I’m also usually pleased with all the superb knowledge you give. Certain 2 facts on this page are ultimately the best we have all ever had.

  5. I intended to send you a very little note to finally say thanks the moment again on the magnificent ideas you have provided in this case. This has been simply tremendously open-handed of you to make freely precisely what a few people could have offered for an ebook to help make some dough for their own end, particularly considering the fact that you could have done it in the event you wanted. These ideas likewise served to be the great way to comprehend most people have a similar dream similar to mine to see much more on the subject of this problem. I believe there are a lot more enjoyable times ahead for those who looked over your blog post.

  6. I wish to get across my love for your generosity supporting persons that must have assistance with this one study. Your real commitment to getting the solution all over turned out to be exceptionally functional and have regularly permitted women much like me to arrive at their desired goals. Your own helpful key points entails so much a person like me and substantially more to my mates. Regards; from all of us.

  7. I wanted to draft you this bit of observation to help say thank you over again for your personal splendid guidelines you’ve shared on this site. This is quite strangely generous with you to supply without restraint all a number of us might have supplied as an electronic book to get some profit on their own, primarily considering that you could possibly have done it if you ever considered necessary. These tactics as well served like the easy way to be sure that some people have a similar interest really like my very own to realize a little more regarding this matter. I am certain there are thousands of more pleasant instances up front for those who scan through your blog post.

  8. I want to show my gratitude for your generosity for men who should have help with the concern. Your special commitment to getting the message all around had been remarkably functional and has without exception allowed individuals just like me to realize their targets. Your own important guidelines implies a great deal a person like me and additionally to my office colleagues. With thanks; from all of us.

  9. I precisely needed to thank you so much again. I am not sure the things I might have sorted out in the absence of those strategies discussed by you about this area. It seemed to be a intimidating problem for me, however , witnessing your skilled approach you processed it forced me to jump over delight. Extremely happy for the information and believe you know what a powerful job you’re getting into instructing most people thru your webblog. Most likely you’ve never got to know any of us.

  10. Thanks for your own efforts on this web site. My daughter loves getting into investigations and it’s obvious why. Most people know all concerning the compelling method you produce reliable suggestions on your website and therefore encourage participation from other individuals on this article while our favorite simple princess is always studying a great deal. Take advantage of the remaining portion of the year. You’re performing a really good job.

  11. I would like to express my gratitude for your kind-heartedness giving support to people that really need help on in this situation. Your very own commitment to getting the solution along has been quite productive and has all the time helped folks like me to achieve their endeavors. Your informative help and advice can mean a great deal to me and extremely more to my colleagues. With thanks; from everyone of us.

  12. I and my guys ended up looking at the best hints on your web page while at once I had a terrible suspicion I never thanked the web blog owner for them. All of the guys were definitely for that reason warmed to study them and have now pretty much been enjoying those things. Many thanks for indeed being considerably kind as well as for getting certain quality subjects most people are really wanting to understand about. My personal honest apologies for not saying thanks to you earlier.

  13. Thank you a lot for providing individuals with an extremely brilliant opportunity to discover important secrets from this site. It really is very useful and jam-packed with a great time for me and my office fellow workers to search your blog a minimum of 3 times a week to find out the new items you have. And lastly, I’m always fascinated concerning the good knowledge served by you. Selected 3 tips on this page are ultimately the most suitable we’ve ever had.

  14. I really wanted to write a quick word so as to thank you for all the pleasant points you are posting on this site. My extended internet investigation has at the end of the day been compensated with reasonable insight to exchange with my classmates and friends. I would claim that we website visitors are truly fortunate to exist in a good place with very many awesome individuals with insightful tips. I feel rather privileged to have used the web pages and look forward to really more fun moments reading here. Thanks again for a lot of things.

Leave a Reply

Your email address will not be published.