WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Custom Permalinks Generated But Not Redirected

[Resolved] Custom Permalinks Generated But Not Redirected

  • In enabled custom permalinks in my Settings area. The string I used was:

    /%year%/%monthnum%/%day%/%postname%/

    The links generated were, predictably,

    http://mysubdomain.mydomain.com/2010/5/15/freeble/fooble/65/

    Or some such. That’s what I would have expected. Now, in my .htaccess, the complete text is:

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

    The problem is that while the URL is as desired, Apache does not seem to be redirecting. I checked and mod_rewrite is installed. What I can see is that a 404 is being issued for the relative pathname. E.g.,

    2010/5/15/freeble/fooble/65/

    I’m thinking the .htaccess is not being seen at all by Apache. Is there something that’s falling in my blind spot?

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • esmi

    @esmi

    Forum Moderator

    Have you tried contacting your hosts? There may be a problem on the server.

    I *am* my host. It’s a VPS. Therein lies my problem 🙂

    Moderator James Huff

    @macmanx

    Support Team Rep.

    You mentioned that you used /%year%/%monthnum%/%day%/%postname%/ but the link that’s generating is /2010/5/15/freeble/fooble/65/ ? Is that correct? If so, try re-saving your permalink structure because that post ID appears to be sneaking in somehow.

    Ok, so I did that, and the link that’s being generated comes out something like:

    http://subdom.domain.com/2010/05/11/zooming-in-photoshop-cs4-and-cs5

    From the custom string:

    /%year%/%monthnum%/%day%/%postname%

    So now the post id is not being included in the string. I’ve resaved the permalink structure using Save Changes on the Permalink Settings page but still see no evidence that the redirection is taking place.

    Weird thing about it is that this works just fine locally. Is there something in the main httpd.conf that could be making Apache not read .htaccess?

    Thanks so much…

    Moderator James Huff

    @macmanx

    Support Team Rep.

    Is WordPress automatically editing the .htaccess file after you save?

    Yup.

    Moderator James Huff

    @macmanx

    Support Team Rep.

    Try this (note the trailing slash at the end):

    /%year%/%monthnum%/%day%/%postname%/

    I did that and still no success. Either Apache is not rewriting the URL (the likely scenario because the logs show a 404), or there is a problem turning the URL into an actual post. I’m stumped.

    Moderator James Huff

    @macmanx

    Support Team Rep.

    Well, everything is setup to the point that it should be working.

    1. mod_rewrite is enabled.
    2. You’re using the approved permalink structure tags.
    3. WordPress is editing the .htaccess file.

    Which brings us back to your question, “Is there something in the main httpd.conf that could be making Apache not read .htaccess?”

    Honestly, I can’t say. You may be better off asking in an Apache forum or your VPS provider’s support forum.

    For now, you can try adding /index.php/ in front of the structure. Ex:

    /index.php/%year%/%monthnum%/%day%/%postname%/

    Dang! That worked. I guess indexes must not include index.php, although that seems a bit unlikely as all sorts of other stuff would be breaking. Anyhow, this is wonderful. Google will love me, and all good things have happened.

    Thank you very much.

    Moderator James Huff

    @macmanx

    Support Team Rep.

    You’re welcome!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] Custom Permalinks Generated But Not Redirected’ is closed to new replies.