WordPress.org

Ready to get started?Download WordPress

Forums

Why won't my permalinks work without index.php? (22 posts)

  1. buskerdog
    Member
    Posted 7 years ago #

    I used to use just %postname% for my permalinks on some other sites since I don't do heavy blogging and like the short URLs. But a new installation I've done won't work unless the permalinks are at least /index.php/%postname%/

    Here's the site (in construction): http://tinyurl.com/ylpvhp Ideas?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    What happens when you don't use the index.php in there? What do you see then?

    Is the site running on Linux/Apache or Windows/IIS or Windows/Apache or what?

    Have you checked the .htaccess file to make sure it exists and is correct?

    Lots of things could cause it. The trick is figuring out what actually is causing it. :)

  3. buskerdog
    Member
    Posted 7 years ago #

    It's running on Linux. And the .htaccess file is there but I haven't edited it since WP didn't give me anything to add to it. I feel like WP 2.03 used to give some stuff to add to .htaccess when you changed the permalinks but newer versions don't. Is that correct?

    Anyway, I changed to the default presentation and edited the permalinks to what I want. Now it gets an error message when selecting categories but it's not my WP 404 error. It's just a blank screen with:

    Not Found
    The requested URL /wp/category/gallery/category/ was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    What is the content of the .htaccess file? You're correct that you don't have to edit it, but you still need to check to make sure that it is actually correct. :)

    Also, what exactly are you changing the permalinks to? What is the content of the fields that you changed? Some things work, other things won't. We need to know exactly what you have in those permalink boxes.

  5. buskerdog
    Member
    Posted 7 years ago #

    Alright, I pulled the .htaccess additional content from another site of mine and now it works. How come WP doesn't tell you what you need to add anymore? That's insane.

    EDIT:
    this is what was in there:

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName http://www.MYDOMAIN.com
    AuthUserFile /home/tag/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/tag/public_html/_vti_pvt/service.grp

    and this is what I added:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    How come WP doesn't tell you what you need to add anymore? That's insane.

    WP will add the necessary code to the .htaccess itself if it can, but if it cannot, it will indeed tell you what to add when you change the permalinks. Scroll down next time.

  7. nik1as
    Member
    Posted 7 years ago #

    I have the same problem. It has worked fine on previous installations, but on this it insists on adding index.php. I realized there was no .htaccess file in the WP directory, so I created an empty one and tried updating the permalink options again. It is still not working, and the .htaccess is still empty.

    What should I do?

  8. Chris_K
    Member
    Posted 7 years ago #

    Start by answering Otto's questions in his first post to this thread.

    What happens when you don't use the index.php in there? What do you see then?

    Is the site running on Linux/Apache or Windows/IIS or Windows/Apache or what?

    Have you checked the .htaccess file to make sure it exists and is correct?

    There's also quite a bit of troubleshooting info at the Permalinks page.

  9. nik1as
    Member
    Posted 7 years ago #

    1. I get a 404 error:

    Not Found
    The requested URL /2006/12/30/test/ was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    2. Linux/Apache

    3. The .htaccess file exists - I created it - and is empty.

  10. Chris_K
    Member
    Posted 7 years ago #

    3) it can't be empty if you want non-default permalinks. IF WP isn't populating it directly, you'll see a message at the bottom of Options -> Permalinks (scroll down!) telling you what should be there.

  11. nik1as
    Member
    Posted 7 years ago #

    I have scrolled down. There's nothing there, I promise.

  12. Chris_K
    Member
    Posted 7 years ago #

    What directory is your blog in?

    That's the .htaccess you're looking at, right?

  13. nik1as
    Member
    Posted 7 years ago #

    My blog is in public_html/addondomain, and there's where the empty .htaccess file is as well.

  14. Chris_K
    Member
    Posted 7 years ago #

    ok, color me stumped.

    How about this: Change that .htaccess to be read-only. Now, revisit Options -> Permalinks and Update.

    This time it'll display contents of what should be in .htaccess. Manually add them and save .htaccess.

    Does that work?

  15. nik1as
    Member
    Posted 7 years ago #

    No. :( It only says "Permalink structure updated", nothing else, but it still doesn't work. I have also tried reinstalling WP several times.

  16. nik1as
    Member
    Posted 7 years ago #

    Can I write something "by hand" in .htaccess?

  17. Chris_K
    Member
    Posted 7 years ago #

    The blog is in the "root" of the domain, right? Try something like:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

  18. nik1as
    Member
    Posted 7 years ago #

    That worked!

    Thank you so much! You made my day. :)

  19. keithd77
    Member
    Posted 7 years ago #

    Wooohooo It works

    I have been trying to figure out how to get ride of that index.php in my permalink for 2 days now and still have all my links work.

    Thank you for this post!

    -Keith

  20. bgajus
    Member
    Posted 7 years ago #

    I'm having the same problem. Only way my permalinks work is when either I use the "ugly" default or if I use something like /index.php/%year%/%monthnum%/%day%/%postname%/
    which obviously shows index.php in the url. I know this server is running Linux/Apache, my site is at the root level and I have edited the .htacess file to read the following....

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Still goes to 404 error. I can't figure out why....

  21. ssoid
    Member
    Posted 7 years ago #

    Works great, thank! Why is wordpress not working correctly though???

  22. orha007
    Member
    Posted 6 years ago #

    This help me too ;)
    tnx...

Topic Closed

This topic has been closed to new replies.

About this Topic