• sunny

    (@sunnyflorida)


    For over a week now I have been trying to change my permalinks from Plain to Post name. I have tried everything and still get 404. I have enabled mod_rewrite. Set permission to 666. And have what looks like a good .htacces in my wordpress root.

    I have taken the time to study how mod_rewrite works and I more or less get it. But I do not understand what is the working relationship between mod_rewrite and wordpress.

    I get that wordpress uses PHP to look into the database to “construct” the “requested” URL. Makes perfect sense and I have written PHP to do it outside of wordpress. But since wordpress constructs the URL I don’t see why it even needs mod_rewrite. It could store in the database the URL format setting and use PHP code to create the Plain or Post name URL.

    So just what happens internally when I switch from Plain to Post name in the Dashboard? And, again, why does wordpress need mod_rewrite?

    Sunny

Viewing 2 replies - 1 through 2 (of 2 total)
  • You haven’t given us much to go by here… I was going to take a look but you didn’t include a URL…

    You mention htaccess but didn’t mention your server type.

    That mod-rewrite helps the server get the requests to htaccess. That’s not just pretty permalinks either. Some admin functions are ‘streamlined’ into the WordPress engine via htaccess. And htaccess works in conjunction with the WordPress engine.

    Once you select a permalink scheme the WordPress internal rewrite engine takes over and sees to it those pretty permalinks are sent out and recognized instead of the numeric post ids.

    I usually select day and name myself. Hit Save and it works. If it doesn’t then hit ‘plain’ save and then day and name… save that again… it should work.

    I think the last time I tried to help someone with issues like this it turned out their server didn’t work with htaccess until he modified the htaccess to work with his server which was Nginx. But the permalinks probably worked regardless as expected.

    If you can’t get you permalinks to work then there may be a problem with the core files in your install. That can happen but you need to figure out a bit about the problem first or else you’ll spend way too much time chasing wrong answers and doing the wrong fixes for the wrong reasons.

    Pretty Permalinks are nice but not the end of the world if you can’t get them working either. Some very highly respected Old School blogs and sites run without them…

    Content is King!

    • This reply was modified 4 years, 4 months ago by JNashHawkins.
    Thread Starter sunny

    (@sunnyflorida)

    I’m working on localhost. High Sierra. Apache v2. PHP v7.

    I have uncommented mod_rewrite. Created an .htaccess with the instructions in the WordPress documents. Set permissions to 666.

    I’ve read how rewrite works. It is a bit complicated but not undecipherable. What I do not understand is the interaction between wordpress and mod_rewrite technically. What happens technically when you change permalink styles and save? It there a flag in the database? Why would wordpress need mod_rewrite at all given the internal PHP in wordpress constructs the URL? Seems like it could construct a Post name URL just as easily as it constructs an Plain URL?

    Trying to under stand the technology so I can figure out why Post name permalinks is not working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting Post name permalinks to work is driving me crazy’ is closed to new replies.