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 trialGiles Hales-Tooke
1,888 PointsPermalinks fail when set to "post name"
Hi
I'm in a situation where my upload works fine, until I try to set the permalinks to post name, at which point my navigation fails with a 404
any ideas?
2 Answers
Rich Bagley
25,869 PointsHi Giles,
I've just checked my local WP installation as I couldn't remember if I had the same issue originally but switching to post name had no effect.
Hopefully one of the following will help point you in the right direction though :)
- https://wordpress.org/support/topic/404-errors-with-permalinks-set-to-postname
- https://wordpress.org/support/topic/permalink-not-working-11
- https://wordpress.org/support/topic/permalinks-wont-work-on-local-pc
-Rich
Giles Hales-Tooke
1,888 PointsHey Rich ... thanks ... I've fixed it in steps as follows (for anybody who might be in the same situation - e.g. setting up virtual hosting to serve multiple WP sites)
The first link (404-errors-with-permalinks-set-to-postname) points to a discussion on using a feature call "mod_rewrite" (basically, this enables "post name" type permalinks to work)
"mod_rewrite" is a bunch of commands saved in a special file called .htaccess - this file sits in the root of each domain that you want to host. It has the dot in front of it to tell your server to hide it (e.g. you will not see it in things like filezilla, but you can open it in a commandline browser with an editor such as nano)
here's the bit that if forgot YOU NEED TO ENABLE MOD_REWRITE by calling sudo a2enmod rewrite
Hope this helps Thanks for the pointer Rich!
Rich Bagley
25,869 PointsNo problem :)