WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] An issue with permalinks / htaccess

[Resolved] An issue with permalinks / htaccess

  • Hi guys. My problem is really simple, but I don’t know how to fix it. I want to use permalinks /%postname% on my site, but it doesn’t work. Permalinks are working correctly when did in form like: /index.php/%postname%. All of us know that links with index.php are quite annoying and I want to get rid of this, but I don’t know how. I’ve modified my .htaccess file with rewrite (my server has mod_rewrite enabled) with no effect. What’s more, my .htaccess file doesn’t work at all – not only with commands connected with rewrite, but even with eg DirectoryIndex. I tried to do something with custom 404, but with this I’m getting redirected to index when trying to enter any article/category. I’m out of ideas, do you have any clues how can I deal with this problem? Thanks for any replies.

Viewing 15 replies - 1 through 15 (of 25 total)
  • Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Are you on a Windows server by any chance?

    Windows servers typically do not recognize .htaccess files, and also often stick that extra index.php in there.

    Best solution: I recommend you switch to Linux hosting if at all possible.

    Otherwise, tell us what server you’re using (exact type & version) and I can do some Googling for you as this issue has come up before, but solutions are server-specific.

    phpinfo() shows Linux as System. Where can I find more detailed information about type & version?

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    The detailed server info was only relevant if you were on a Windows server.

    Since you’re running on Linux, I would put in a ticket with your web host to get their help finding out why your .htaccess is not working at all. Once you get the .htaccess working, hopefully your /index.php issue will get resolved, once the WP rewrite rules are working properly.

    Thanks for your replies, I’ll ask my webhost for help.

    … anyway it’s really weird.

    I got a reply. They said, that .htaccess files (including mod_rewrite) on the all of their servers are working properly and it must be wordpress’ fault. Any new ideas?

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Does your .htaccess have any blank lines at the beginning or end of it? That can screw it up.

    It doesn’t matter, .htaccess doesn’t work even with or without blank lines.

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Hi shog, perhaps a longshot, but what program are you using to edit the .htaccess file?

    Is it a true plain-text app or a real code editor?

    I’ve seen .htaccess files get totally messed up when unknowingly edited in a program that was adding extra “junk” to the file – even Dreamweaver in code view is no good for editing .htaccess, for example.

    TextEdit for Mac or Notepad for PC – set to plain-text mode – are two good bets and everyone usually already has them.

    I’m usually using Notepad2, but even with default Notepad with plain-text mode I can do nothing. Btw. when I delete .htaccess file, nothing happens. File generates when I set my permalink structure to /%postname/, but it’s all – the file is only generated, it still doesn’t work.

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Could you paste the contents of that auto-generated .htaccess into a Pastebin and then give the link here?

    http://pastebin.com/

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Thanks. Could I get a link to your site as well?

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    I see your links like:

    http://www.czasfutbolu.pl/index.php/kategoria/wywiady/

    http://www.czasfutbolu.pl/index.php/radoslaw-gilewicz-o-kadrze-na-100-dni-przed-euro/

    Those look an awful lot like the PATHINFO-type links described here.

    I’m not sure why your site would be using those instead of mod_rewrite if you say your server has mod_rewrite enabled.

    What is your custom permalink set to in Settings?

    I’m also going to try to get another set of eyes or two on this.

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    my server has mod_rewrite enabled

    In the meantime, could you perhaps double-check this in your phpinfo() file?

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘[Resolved] An issue with permalinks / htaccess’ is closed to new replies.
Skip to toolbar