The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess help needed - Important

Discussion in 'General Discussion' started by SaN-DeeP, Mar 21, 2006.

  1. SaN-DeeP

    SaN-DeeP Member

    Joined:
    Jan 5, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I am running couple of sub-domains via our main domain: http://www.mydomain.in
    Sub-domains in use:
    http://forums.mydomain.in
    http://gallery.mydomain.in


    I am having some serious issues with this domain as follows:

    1. Serps + Guests are able to get to my sub-domains from following URLs as well:
    www.mydomain.in/forums/somepage
    forums.mydomain.in/somepage
    000.000.000.000/forums/somepage
    This is creating lot of dupe content, i want to fix this problem, with a 301/permanent re-direct (without loosing any rankings or getting penalties)

    2. I am running a forum software script, any user typing a wrong URL or trying to access any improper location should to be re-directed to the root. I want to achieve following if a user tries to access:
    forums.mydomain.in/showthread.php?t=1233 which does not exists (reason got deleted)
    should be re-directed properly to forums.mydomain.in


    3.
    There are many pages indexed in Google and Yahoo via our Site IP Address as well for example:
    000.000.000.000/forums/somepage
    I want to re-direct such pages to forums.mydomain.in/somepage

    4. While trying to re-direct users from 404 URLs on forum, entire .CSS and image paths appear to be invalid, is there a possible solution for re-directing users from 404 pages to root properly?


    This are my .htaccess files:
    This are the .htaccess files on my domain currently as follows:
    ########################################
    #http://www.mydomain.in/.htaccess#
    ########################################
    ErrorDocument 400 /
    ErrorDocument 401 /
    ErrorDocument 403 /
    ErrorDocument 404 /
    #
    Options +Indexes +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    #
    # Prevent duplicate content on gallery and forums subdomain
    RewriteCond %{HTTP_HOST} ^(gallery|forums)\.mydomain.in
    RewriteRule ^(gallery|forums)(.*)$ http://%{HTTP_HOST}$1 [R=301,L]
    #
    #Re-Direct users coming to forums and gallery via IP Address in SERPs index to proper location
    RewriteCond %{HTTP_HOST} ^000\.000\.000\.000
    RewriteRule ^(gallery|forums)/(.*)$ http://$1.mydomain.in/$2 [R=301,L]
    #
    #Re-Direct users coming to Site via IP Adress to proper location
    RewriteCond %{HTTP_HOST} ^(000\.000\.000\.000|mydomain\.in)
    RewriteRule (.*) http://www.mydomain.in/$1 [R=301,L]
    ########################################

    ########################################
    #http://forums.mydomain.in/.htaccess#
    ########################################
    ErrorDocument 400 /
    ErrorDocument 401 /
    ErrorDocument 403 /
    ErrorDocument 404 /
    #
    Options +Indexes +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    #
    #Re-Direct users coming to /forums/ to proper subdomain
    redirect 301 /forums/ http://forums.mydomain.in/
    ########################################

    ########################################
    #http://gallery.mydomain.in/.htaccess#
    ########################################
    ErrorDocument 400 /
    ErrorDocument 401 /
    ErrorDocument 403 /
    ErrorDocument 404 /
    #
    Options +Indexes +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    #
    #Re-Direct users coming to /gallery/ to proper subdomain
    redirect 301 /gallery/ http://gallery.mydomain.in/
    ########################################

    1. Please check the above codes those are working perfectly fine on my domain currently, if you can further provide some more optimizations if needed please let me know.

    2. Will i face any problems in future/present using those .htaccess codes? I dont wish to loose my listings/rankings.

    3. I dont want to loose the indexed contents via IP Address (lakhs of pages indexed via IP) and also via improper domain handling.
    i.e., www.mydomain.com/forums/ (lakhs of pages indexed via improper domain URL)
     
  2. SaN-DeeP

    SaN-DeeP Member

    Joined:
    Jan 5, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    is there anyone on internet who can help me fix my problems ? :)
     
Loading...

Share This Page