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

Lucas Santos
Lucas Santos
19,315 Points

Wordpress Permalink 404 Error

Hey guys iv been working with Wordpress a lot and yesterday iv ran into a problem that got me stuck. I think iv fixed it but I still want to ask anyways and make sure. So im developing locally on MAMP and made a folder name called "My Website" installed Wordpress and what not. Then I made a simple Sample Page and saw that the permalink on top of the URL looked like gibberish after the slash, so I switched the permalink settings to read the "post name" and when I did that I could not view any of my pages instead I got my 404 Error Message and it only worked when I went back to the default permalink settings. So I searched around and read a lot about changing my htaccess and all these other techniques. But I thought to myself out of all the Wordpress websites I have developed I never had to do any other configuration after switching the permalink settings to post name. So I kept looking and saw that my URL read the space in between my websites name as http://localhost/My%20Website/ ... At first I did not think the space in between my domain name mattered in local development but then I changed my folder name in sites folder and took out that space and went in general settings and took out the space there and it worked.

So now the question is why did it not let me use a space in my domain name while developing "Locally"? And was that a permanent fix? Never really ran into a permalink problem so some explanation on this would be helpful.

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Hi!

You definitely don't want spaces in your URL. This goes for both local and live development, since problems like you've seen can occur regardless of whether you're working locally or live.

If you removed the space and updated the permalinks and they work now you should be good to go :)

Lucas Santos
Lucas Santos
19,315 Points

Didn't think it mattered locally, thanks Zac you're the man.