Results 1 to 6 of 6

Add www to forum url with no trailing slash

This is a discussion on Add www to forum url with no trailing slash within the General Discussion forums, part of the vBulletin SEO Discussion category; Good morning, I'm using the following .htaccess code to add a www to the url of my forum webpages: HTML ...

  1. #1
    Junior Member
    Real Name
    David
    Join Date
    Apr 2006
    Posts
    22
    Liked
    0 times

    Add www to forum url with no trailing slash

    Good morning,

    I'm using the following .htaccess code to add a www to the url of my forum webpages:

    HTML Code:
    RewriteCond %{HTTP_HOST} !^www\.diabetesdaily\.com
    RewriteRule (.*) http://www.diabetesdaily.com/forum/$1 [R=301,L]
    This works flawlessly EXCEPT when there is no trailing slash on the url. For example:
    http://diabetesdaily.com/forum

    In this case, it appends the home directory on my server to the url like this:

    http://www.diabetesdaily.com/forum//...lic_html/forum

    Any ideas on how to fix this?

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Please try to add another rewrite condition:
    Code:
    RewriteCond %{REQUEST_URI} forum/

  3. #3
    Junior Member
    Real Name
    David
    Join Date
    Apr 2006
    Posts
    22
    Liked
    0 times
    Thanks! It works perfectly. For future reference, here's what my .htaccess rule looks like:

    Code:
    RewriteCond %{HTTP_HOST} !^www\.diabetesdaily\.com$
    RewriteCond %{REQUEST_URI} forum/
    RewriteRule (.*) http://www.diabetesdaily.com/forum/$1 [R=301,L]
    Last edited by Brian Cummiskey; 11-08-2010 at 02:38 PM.

  4. #4
    Member
    Real Name
    Imran
    Join Date
    Nov 2006
    Posts
    47
    Liked
    0 times
    It helped me too thanks....

  5. #5
    Junior Member
    Real Name
    Eko Puspo Christiawan Febianto
    Join Date
    Mar 2012
    Posts
    1
    Liked
    0 times
    Nice..This work for my forum too
    Thanks

  6. #6
    Junior Member
    Real Name
    Bobby
    Join Date
    Mar 2012
    Posts
    2
    Liked
    0 times
    Worked with Slash on every special character used in the URL. But this seems to be easy then before.

Similar Threads

  1. vBSEO 2.0 RC7 Released
    By Juan Muriente in forum vBSEO Announcements
    Replies: 17
    Last Post: 09-08-2005, 11:00 PM

Posting Permissions

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