Results 1 to 8 of 8

Thread: 301 redirect

  1. #1
    Join Date
    Apr 2007
    Location
    Olongapo, Philippines
    Posts
    138

    Default 301 redirect

    Hello everyone

    Can someone direct my how to perform a 301 redirect for me directory please. You know from http://domain.com to http://www.domain.com

    thanks

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    I use the following, replace my domain with yours and enter it AFTER the line that says # INDEX END

    RewriteCond %{HTTP_HOST} ^moparmuscle.net$
    RewriteRule ^(.*)$ http://www.moparmuscle.net/$1 [R=301,L]
    ErrorDocument 404 http://www.moparmuscle.net/

  3. #3
    Join Date
    Apr 2007
    Location
    Olongapo, Philippines
    Posts
    138

    Default

    Enter this where pls? Do you mean the .htaccess file?
    Last edited by spin; 07-22-2007 at 07:20 PM.

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    In .htaccess yes

  5. #5
    Join Date
    Apr 2007
    Location
    Olongapo, Philippines
    Posts
    138

    Default

    thanks for reply......I did as instructed....their was no redirect and I got 404 when i clicked a category...

  6. #6
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Either you did it wrong, or your host doesn't allow 301 redirects. Paste your .htaccess here and I'll confirm it.

  7. #7
    Join Date
    Apr 2007
    Location
    Olongapo, Philippines
    Posts
    138

    Default

    Code:
    # INDEXU-START
    
    # DO NOT CHANGE THE FOLLOWING LINES
    # status: 1
    # pattern_category: {$cat_path}/more{$page}.html
    # pattern_detail: detail/{$link_id}/{$link_title}.html
    # pattern_tag: tag/{$tag}/more{$page}.html
    
    Options -MultiViews
    RewriteEngine On
    
    RewriteRule ^detail/(.*)/(.*).html detail.php?linkid=$1
    RewriteRule ^tag/(.*)/more(.*).html browsetag.php?tag=$1&pg_which=$2
    RewriteRule ^tag/(.*) browsetag.php?tag=$1
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^.* browse.php
    
    # INDEXU-END
    RewriteCond %{HTTP_HOST} ^pirahnaseek.com$ 
    RewriteRule ^(.*)$ http://www.pirahnaseek.com/$1 [R=301,L]
    ErrorDocument 404 http://www.pirahnaseek.com/

    OK now it will rediret like this but becomes non seo friendly...I want a seo friendly directory
    any suggestions?
    Last edited by spin; 07-23-2007 at 01:50 AM.

  8. #8
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    About the only thing you can add/change is the following. Otherwise it is all correct and will be redirecting and still seo friendly.

    # INDEXU-END

    rewriteBase /

    RewriteCond %{HTTP_HOST} ^pirahnaseek.com$
    RewriteRule ^(.*)$ http://www.pirahnaseek.com/$1 [R=301,L]

    The last line (404) isn't necessary. You can try taking that one out. I included it but shouldn't have.

    If it's not functioning then talk to your host and ensure that you have permissions to run everything in the htaccess. Also some servers run things differently, your host may have suggestions.

Similar Threads

  1. [important]302 redirect
    By dody in forum v5.x
    Replies: 20
    Last Post: 05-12-2005, 06:30 PM
  2. Redirect needed
    By Compdoctor in forum v3.2
    Replies: 6
    Last Post: 05-22-2002, 09:46 AM

Posting Permissions

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