The MU forums have moved to WordPress.org

.htaccess problem not getting the right URL (6 posts)

  1. pawiz
    Inactive
    Posted 19 years ago #

    I don't know what's happening, i've tried some modifications to the .htaccess suggested here and it still doesnt work

    The problem is this:

    When i want to post a comment, I get redirected to http://blog.mydomain.com/wp-comments-post/ instead of http://blog.mydomain.com/wp-comments-post.php (it removes the .php part of the url)

    See it yourself in this example blog:

    http://pawpaw.blogs.3.1416.cc/ (try to post a comment on the first post)

  2. ballen
    Member
    Posted 19 years ago #

    Was going to try to help out, but it looks like you blasted that particular blog... You have another example?

  3. pawiz
    Inactive
    Posted 19 years ago #

    hehehe sorry... im playing around with the .htaccess

    Try again, it's working now...

  4. pawiz
    Inactive
    Posted 19 years ago #

    I've been watching the rewrite log (to activate it put RewriteLog "/path/to/your/rewrite.log" and RewriteLogLevel 3 into you httpd.conf) and i noticed that all the pages, ending or not with .php are not matched by any rule in the .htacces but the catch all rules and then it parses again all the rules.

    That's why i get redirected to wp-comments-post/ instead of wp-comments-post.php; It seems that Apache is ignoring the [L] wich means that it should stop when that rule is matched or perhaps there's another rule before these, that is changing the url to wp-comments-post/ ... that's so confusing because i've just commented out every line in the .htaccess except these:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php /wp-inst/index.php [L]
    RewriteRule ^$ /wp-inst/index.php [L]
    RewriteRule ^([_0-9a-zA-Z-]+)/ /wp-inst/index.php [L]
    RewriteRule ^([_0-9a-zA-Z-]+) $1/ [L,R]
    AddType text/css .css

    And it works exactly the same way as described above, which means that all the other rules are being ignored..

  5. pawiz
    Inactive
    Posted 19 years ago #

    Sorry, im trying to find out which rules are used and which ones not..

    Right now i have these rules:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^([_0-9a-zA-Z-]+)/templates/(.*) /wp-inst/wp-content/blogs/$1/templates/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]
    RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/themes/(.*) /wp-inst/wp-content/themes/$2 [L]
    RewriteRule ^wp-content/themes/(.*) /wp-inst/wp-content/themes/$1 [L]
    RewriteRule ^index.php /wp-inst/index.php [L]
    RewriteRule ^$ /wp-inst/index.php [L]
    RewriteRule ^([_0-9a-zA-Z-]+)/ /wp-inst/index.php [L]
    RewriteRule ^([_0-9a-zA-Z-]+) $1/ [L,R]
    AddType text/css .css

  6. pawiz
    Inactive
    Posted 19 years ago #

    Ok, i just got a solution from this issue:

    in .htaccess

    Replace ^([_0-9a-zA-Z-]+)/ to ^ from all lines that are after this:
    # We want to pass these files straight through
    Example:
    Before: RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-post.php(.*) /wp-inst/wp-comments-post.php [L]
    After: RewriteRule ^wp-comments-post.php(.*) /wp-inst/wp-comments-post.php [L]

    Hope it works.. :)

About this Topic