WordPress.org

Ready to get started?Download WordPress

Forums

Help me sort out mod rewrite permalinks? (14 posts)

  1. TMo
    Member
    Posted 9 years ago #

    I've tried this several times, but can't seem to get it to work.
    If I set my permalink structure to something like:
    /%year%/%monthnum%/%day%/%postname%/
    and the "you should have this in your .htaccess" box says:
    'RewriteEngine On
    RewriteBase /
    RewriteRule ^category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^([0-9]{4})/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    RewriteRule ^([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
    RewriteRule ^([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]'
    I just end up getting a "no permissions" when I try to go to my site.
    Mod_rewrite is enabled. Any ideas?

  2. And did you add that code into your .htaccess file?

  3. TMo
    Member
    Posted 9 years ago #

    Sorry, should've said . . ."I just end up getting a "no permissions" . ."can't access /", when I put that in my .htaccess and go to my site.

  4. Odd. Is your .htaccess file in the same directory as the index.php for your blog. Does the .htaccess file have 666 permissions (chmod 666)?

  5. TMo
    Member
    Posted 9 years ago #

    Ok, double checked that, then I get.
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    should I need index.php/path/to/whatever ? Or I can do without the index.php?

  6. TMo
    Member
    Posted 9 years ago #

    Error in the code, fixed it, back to 403.

  7. Do you mean a 403 when you try to access your .htaccess through a browser? If that's the case, you should. You can edit your .htaccess file either through your computer via FTP (downloading, editing, delete the original off the server, and upload edited file) or through the WordPress templates editing area (assuming that .htaccess has 666 permissions). Sorry I didn't think of that earlier.

  8. TMo
    Member
    Posted 9 years ago #

    No. I mean I shell in and edit my .htaccess in Vi. Then I go to the browser and go to http://www.tekmonki.com. 403.
    I chmod 666 .htaccess
    go to http://www.tekmonki.com.
    403.

  9. Ouch, you should probably email your host over that. Something is really wrong on their end.

  10. TMo
    Member
    Posted 9 years ago #

    Before I do that, any ideas as to what may be the problem? I find it's helpful if I can say "x is doing y" instead of . . ."this isn't working'. Things tend to get done faster that way I've noticed. = ]

  11. "I have edited my .htaccess file as directed by WordPress, which seems to work for everyone else. However, my site is now giving me 403 errors. Would you mind taking a look at the .htaccess file and telling me what's wrong?" Or something like that ^_-

  12. TMo
    Member
    Posted 9 years ago #

    So I'm told that I need to edit my httpd.conf file as it doesn't work on virtual hosts. So I put the rewrite rules in there and the site mostly works, but clicking on a post gives "page not found". Any thoughts?

  13. carthik
    Member
    Posted 9 years ago #

    The problem with putting those rules elsewhere is that the RewriteBase instruction is bound to be read wrong.
    RewriteBase /
    means that all requests will be rewritten with the current directory (Same as that of httpd.conf) as the base. Try changing that to the absolute path of your wp index.php file, or the relative path from the dir containing the httpd.conf to the index.php file.

  14. carthik
    Member
    Posted 9 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.