• Resolved seofanatic

    (@seofanatic)


    Hi,

    I have a business related site that I installed WordPress 2.5.1 on. The blog was installed at http://www.mysite.com/blog

    I already had a .htaccess file going on my site which redirects http://mysite.com and http://www.mysite.com/index.php to http://www.mysite.com

    Now that I installed the new WordPress I am seeing an redirect loop, so I can’t seem to access the blog at all.

    I want to keep the redirects in place for my site, but still be able to use the blog. I understand there is something hard-coded into the new version which is causing the redirect loop. Is there any way to change this in the options?

    I was thinking about renaming the .htaccess temporarily, logging into WordPress and making some changes to the options or coding if it’s possible to remove the redirect within the blog files.

    Any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Totally a stab in the dark, but . . .
    1.By default I believe the WordPress htaccess file feeds all urls into index.php as shown by this line in the htaccess file

    RewriteRule . /index.php [L]

    If you are redirecting index.php to domain then wordpress may be trying to send it back to index.php causing the loop.

    2. Perhaps your permalink settings (or .htaccess file) in WordPress are causing /blog to looked up as a post or page instead of an existing file or folder. Your .htaccess file should have

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    which tells apache to only rewrite /urls that are not aleady existing as files (-f) or directories(-d).

    3.I believe since 2.3 wordpress has offered built in redirection of www to non-www or vice-versa. This is setup in your Settings.

    Your blog address and wordpress address should probably be different.

    WordPress Address: http://www.mysite.com/blog
    Blog Address: http://www.mysite.com/blog (using a www or not here will effect how WordPress redirects requests).

    Hope that helps.

    Aaron
    WPCast.com (coming soon)

    Thread Starter seofanatic

    (@seofanatic)

    Aaron,

    Thanks so much for your response, it got the wheels turning… what I discovered is that I hadn’t even created the custom permalinks yet, which is usually the first thing I do. Once I created the permalinks, which created the blog’s .htaccess file and parameters, everything worked fine. I was able to leave my main site’s .htaccess file intact with the same redirects, and it works in harmony with the blog.

    I’m glad I figured that one out because it was driving me nuts. If I would have only known that it was that easy. Now I feel stupid, but at least the blog is working right! Thanks for your help.

    No problem. I’m glad things are working for you know. Congrats on the killer domain too. . .I’ve often wondered how much free traffic domains that people may be using as an example of a domain get. I guess yoursite.com would be better, but mysite.com is still pretty killer.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘using non-www .htaccess redirects with 2.5.1’ is closed to new replies.