How to create 301 Redirect for subpages..?

Discussion in 'Apache' started by me4all, Oct 5, 2011.

  1. #1
    I am getting lots of errors in google webmaster tools because of duplicate URL/content. So i am trying to do 301 redirect to one domain. I use joomla platform if i redirect from justdownload.in to www.justdownload.in backend also getting redirected to www.justdownload.in/index.php how to avoid this?


    So i have redirected from www.justdownload.in to justdownload.in. but the problem is google has indexed more pages with www.justdownload.in and also i got more backlinks for www.justdownload.in and so if some one search for something on google and come to my site they are all landing to homepage not subpage. please help i am loosing lots of visitors.

    I searched google and got this code do i need to alter anything so that my visitors land to sub pages.
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^www.justdownload.in [nc]
    rewriterule ^(.*)$ http://justdownload.in/$1 [r=301,nc]
     
    me4all, Oct 5, 2011 IP
  2. sparek

    sparek Peon

    Messages:
    68
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    To redirect www.justdownload.in requests to just justdownload.in add this to your .htaccess file

    RewriteEngine on
    RewriteCond %{HTTP_HOST} =www.justdownload.in [NC]
    RewriteRule ^ http://justdownload.in%{REQUEST_URI} [R=301,L]
    Code (markup):
    This should redirect any http://www.justdownload.in/page to http://justdownload.in/page with a 301 Permanently Moved redirect.
     
    sparek, Oct 5, 2011 IP