Results 1 to 9 of 9

htaccess

This is a discussion on htaccess within the General Discussion forums, part of the vBulletin SEO Discussion category; I'm trying to configure my root htaccess file to: 1.) Redirect my domain.com to domain.com/forums/index.php 2.) Force the use of ...

  1. #1
    Junior Member
    Real Name
    Jeffrey Sigmon
    Join Date
    Feb 2009
    Location
    New Orleans, LA
    Posts
    12
    Liked
    0 times

    htaccess

    I'm trying to configure my root htaccess file to:

    1.) Redirect my domain.com to domain.com/forums/index.php
    2.) Force the use of www.

    Any help is much appreciated.

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

    you can try this:
    Code:
    RewriteEngine on
    
    RewriteRule ^$ http://www.domain.com/forums/index.php [L,R=301]
    
    RewriteCond %{HTTP_HOST} !^www\.domain\.com
    RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
    Last edited by Oleg Ignatiuk; 02-13-2009 at 11:47 AM. Reason: added [L,R=301]

  3. #3
    Junior Member
    Real Name
    Jeffrey Sigmon
    Join Date
    Feb 2009
    Location
    New Orleans, LA
    Posts
    12
    Liked
    0 times
    I get a Bad Request error.

    I notice the url becomes http://www.domain.com//forums/index.php

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Try to replace the second line with:
    Code:
    RewriteRule ^$ http://www.domain.com/forums/index.php [L,R=301]
    Can you post your domain name?

  5. #5
    Junior Member
    Real Name
    Jeffrey Sigmon
    Join Date
    Feb 2009
    Location
    New Orleans, LA
    Posts
    12
    Liked
    0 times
    I'm currently using this:

    Code:
    I'm currentRewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^/?$ "http\:\/\/www\.domain\.com\/forums\/index\.php" [R=301,L]
    and that redirects to the forum index.php, but I can't see how it is forcing www.

  6. #6
    Junior Member
    Real Name
    Jeffrey Sigmon
    Join Date
    Feb 2009
    Location
    New Orleans, LA
    Posts
    12
    Liked
    0 times
    I made your change and it seems to be working now.

  7. #7
    Junior Member
    Real Name
    Jeffrey Sigmon
    Join Date
    Feb 2009
    Location
    New Orleans, LA
    Posts
    12
    Liked
    0 times
    One last question,

    Would it be better to redirect to http://www.domain.com/forums

    OR

    http://www.domain.com/forums/index.php

  8. #8
    Senior Member Shadab's Avatar
    Real Name
    Shadab
    Join Date
    Oct 2007
    Location
    Bhopal
    Posts
    821
    Liked
    0 times
    Blog Entries
    12
    IMO, www.domain.com/forums/ would be the best option.

  9. #9
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times
    Yes, agree.

Similar Threads

  1. Replies: 5
    Last Post: 05-12-2009, 03:29 PM
  2. current .htaccess vs vbseo .htaccess
    By karlm in forum Pre-Sales Questions
    Replies: 7
    Last Post: 08-26-2008, 08:48 PM
  3. Wordpress htaccess + vbseo htaccess
    By chris06 in forum URL Rewrite Settings
    Replies: 1
    Last Post: 11-01-2007, 11:56 AM
  4. .htaccess in forum root w/ exisiting .htaccess?
    By OttoBomb in forum Troubleshooting
    Replies: 5
    Last Post: 07-03-2007, 03:45 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
  •