Results 1 to 11 of 11

Incorrectly redirecting from www.mydomain to mydomain.com

This is a discussion on Incorrectly redirecting from www.mydomain to mydomain.com within the Troubleshooting forums, part of the vBSEO SEO Plugin category; I have a .htacces like this : PHP Code: Options  + FollowSymlinks RewriteEngine on Rewritecond  %{ http_host } ^ mydomain \. com  ...

  1. #1
    Junior Member
    Real Name
    fischermx
    Join Date
    Sep 2006
    Posts
    27
    Liked
    0 times

    Incorrectly redirecting from www.mydomain to mydomain.com

    I have a .htacces like this :

    PHP Code:
    Options +FollowSymlinks
    RewriteEngine on
    Rewritecond 
    %{http_host} ^mydomain\.com [nc]
    Rewriterule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc]
    RewriteCond %{REQUEST_URI} !^/foros
    RewriteRule 
    ^(.*)$ /foros [r=301,nc
    Since I have nothing on the root for now (planned to future).
    Now, when my the visitor arrives at http://www.mydomain.com/foros, it is sent back to http://mydomain.com/foros !
    I notice that if I get ride of the .hattaccess on the /foros root, it works as it used to work, so, it is the new .htaccess which is causing this.

    Where do I configure this ? I want to keep the "www" always.

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Hello,

    please try to change
    Code:
    RewriteCond %{REQUEST_URI} !^/foros
    to:
    Code:
    RewriteCond %{REQUEST_FILENAME} !^foros
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Junior Member
    Real Name
    fischermx
    Join Date
    Sep 2006
    Posts
    27
    Liked
    0 times
    mmm still does not redirect correctly.
    going to www.mysite.com sends me to mysite.com/foros

    Before I installed vBSeo my .htaccess was doing what I wanted.
    I guess it might need to be modified, though.
    Last edited by fischermx; 09-05-2006 at 05:30 PM.

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Did you change your vBSEO's .htaccess file?
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    Junior Member
    Real Name
    fischermx
    Join Date
    Sep 2006
    Posts
    27
    Liked
    0 times
    I didn't change it a bit.
    I tried to include the rewritebase like this:
    RewriteBase /foros/

    But it didn't make any difference.

    Did I have to change something else in the vbSeo .htaccess?
    Last edited by fischermx; 09-05-2006 at 06:32 PM.

  6. #6
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    When I open http://www.yourdomain.com/foros/ it is loaded correctly without redirects. Do you still have the issue?
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  7. #7
    Junior Member
    Real Name
    fischermx
    Join Date
    Sep 2006
    Posts
    27
    Liked
    0 times
    I think this solved it:

    PHP Code:
    Options +FollowSymlinks
    RewriteEngine on
    Rewritecond 
    %{http_host} ^mydomain\.com [nc]
    Rewriterule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc]
    Rewritecond %{http_host} ^www.mydomain\.com$ [nc]
    Rewriterule ^(.*)$ http://www.mydomain.com/foros/$1 [r=301,nc] 

  8. #8
    Junior Member
    Real Name
    fischermx
    Join Date
    Sep 2006
    Posts
    27
    Liked
    0 times
    I fixed a few minutes before your post by modifying my root .htaccess.
    Still I don't know why it worked, why it stopped to work and why the new version is working fine now ...
    Sorry, I'm a total rewrite ignorant.

  9. #9
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    The following should be better:
    Code:
    Options +FollowSymlinks
    RewriteEngine on
    Rewritecond %{http_host} ^mydomain.com [nc]
    Rewriterule ^(.*)$ http://www.mydomain.com/$1 [L,r=301,nc]
    Rewritecond %{REQUEST_FILENAME} !^foros
    Rewriterule ^(.*)$ http://www.mydomain.com/foros/$1 [r=301,nc]
    because last rewrite rule in your .htaccess will force endless loop of redirects if you will remove vBSEO's .htaccess.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  10. #10
    Junior Member
    Real Name
    fischermx
    Join Date
    Sep 2006
    Posts
    27
    Liked
    0 times
    Yes, that one worked as well. I'll keep your version.

    Thanks a lot !

  11. #11
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    You are welcome!
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •