Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 4 of 4

This is a discussion on Redirection of a domain name using .htaccess in the Open Discussion & Chit-chat forum
I'm looking for a way to redirect all requests of http://spinelli-group.com to http://www.spinelli- group.com (hosted on JaguarPC). I want a "true redirect" so search engines ...

  1. #1
    JPC Member
    Join Date
    Sep 2002
    Location
    Italy
    Posts
    31

    Question Redirection of a domain name using .htaccess

    I'm looking for a way to redirect all requests of http://spinelli-group.com to http://www.spinelli- group.com (hosted on JaguarPC).

    I want a "true redirect" so search engines will correct their indexes to the new address using the address with "www" only.
    I have the problem that some people use the address without "www" and other with "www" adding more traffic to my website (because of double-caching of the same pages).

    Please let me know if there is a way to configure the .htaccess file or other good solution.

    Thanks, Alex
    Visit VirtualPostcard at http://www.spinelli-group.com/vcard

  2. #2
    JPC Member
    Join Date
    Sep 2002
    Location
    Italy
    Posts
    31

    Ops.... duplicated my post

    Visit VirtualPostcard at http://www.spinelli-group.com/vcard

  3. #3
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    I think this will do what you want. It uses mod_rewrite, so you should check with support before doing this because I think they want to monitor people's use of mod_rewrite. It can cause a lot of problems if you don't know what yoou are doing...

    Code:
    RewriteCond %{HTTP_HOST}   !^www\.domain\.com [NC]
    RewriteCond %{HTTP_HOST}   !^$
    RewriteCond %{SERVER_PORT} !^80$
    RewriteRule ^/(.*)         http://www.domain.com:%{SERVER_PORT}/$1 [L,R=301]
    RewriteCond %{HTTP_HOST}   !^www\.domain\.com [NC]
    RewriteCond %{HTTP_HOST}   !^$
    RewriteRule ^/(.*)         http://www.domain.com/$1 [L,R=301]
    It should check the URL and if it does not use "www" it should do a permanent redirect (HTTP Code 301, the R=301 in the examples) to the www version of the smae url.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  4. #4
    JPC Member
    Join Date
    Sep 2002
    Location
    Italy
    Posts
    31

    Wow thanks!

    Thanks very much Jason!!!
    it's what i was looking for... i'll try this solution.

    Bye, Alex
    Visit VirtualPostcard at http://www.spinelli-group.com/vcard

Bookmarks

Posting Permissions

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