Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Admin Settings WordPress Admin Settings WordPress Permalink Settings

Magnus Rydberg
Magnus Rydberg
4,683 Points

404 error after changing the WordPress Permalink settings

I have a local installation of WordPress on WAMP. I had previously changed the permalink settings to from Default to Custom Structure /%postname%/

I again changed the settings to Post name option and after that I can only access the home page. For example the blog page gives me the following error.

The requested URL /firstwordpress/blog/ was not found on this server

Searching online for a solution I came across this page.

http://pixelragelm.hubpages.com/hub/wordpress-not-found-error-fix

The article suggests I change the CHMOD settings on .htaccess from 644 to 666. I found the .htaccess file and opened up properties but could not find that setting. (I am using Windows 10) I am not even sure that chnaging this setting is the right resolution.

Please suggest a way from me to troubleshoot and correct this error.

UPDATE: Reading posts in the Wordpress forum from people with the same problem I learned that CHMOD settings only applies to Linux and Unix. There is no such thing in Windows from what I gather.

I just tried changing the security settings and temporarily allow write permissions for all users on the .htaccess file. The problem remained though.

Next I changed the Permalink settings to Default again and now the 404 error is gone. I will stay with this setting in order to continue with the course. It would still help me a lot to learn how to resolve the error and having explanation on what caused it. Any pointers much appreciated.

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Try seeing if this helps: https://wordpress.org/support/topic/404-errors-with-permalinks-set-to-postname

It sounds like something related to WAMP processing the .htaccess file or WP maybe not having access to edit it.

Magnus Rydberg
Magnus Rydberg
4,683 Points

Hello Zac

Thank you very much for getting back to me. I looked closer at the thread you linked to and found a resolution to my problem in an entry from the user djmiller78 who was also working om WordPress locally with WAMP. The root cause as djmiller78 explained it was: "The problem was (for me) that Apache installs with rewrites disabled so I had to enable rewrites_module."

The solution was to enable to WAMP > Apache > Apache Modules > rewrite_module Just click to enable. WAMP restarts (Icon turns orange and then back to green).

The link below explain the steps on WAMP but also for any other kind on Apache install or OS.

https://github.com/h5bp/server-configs-apache/wiki/How-to-enable-Apache-modules.

I also found an article that goes deeper into mod_rewrite:

http://code.tutsplus.com/tutorials/an-in-depth-guide-to-mod_rewrite-for-apache--net-6708