Help Needed To Redirecting SubFolder of Site Root

Discussion in 'Site & Server Administration' started by techbongo, Aug 5, 2009.

  1. #1
    Hi Folks,

    This time I need help for my website http://techbongo.com as I've got lot of unnecessary old links picked up by search engines.

    I had my old site on http://techbongo.com/home/ where Joomla was installed. Now my new site is located on http://techbongo.com/
    I want to redirect each and every files/folders under 'home' sub-folder to http://techbongo.com/
    I don't want to add the query strings of home folders to the root folder. I mean, I just need a permanent wildcard redirect of 'home' sub folder to the root folder and don't want to append anything else to the root folder while redirecting .

    I know, some brilliant Apache experts are here. Please help he with the .htaccess code.

    I'm facing great trouble in SEO as all the 30 files of my total listed 54 files are not existing now. That's I need this help. By the way, will it affect my ranking anyhow?
     
    techbongo, Aug 5, 2009 IP
  2. Pathan

    Pathan Well-Known Member

    Messages:
    2,196
    Likes Received:
    218
    Best Answers:
    0
    Trophy Points:
    165
    #2
    Pathan, Aug 5, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^techbongo.com/home [nc]
    rewriterule ^(.*)$ http://www.techbongo.com/$1 [r=301,nc]


    put that code in .htaccess of ur home directory
     
    Bohra, Aug 5, 2009 IP
  4. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #4
    I don't want to redirect a url, say hxxp://techbongo.com/home/content/index.php?itemid=5 to hxxp://techbongo.com/content/index.php?itemid=5, rather I'll like it redirected to http://techbongo.com/ itself.

    I don't know, if this piece of code will work or not. Will it work?

    I guess, you got my point. I want a wilcard redircted to my site root without appending any querystring/sub-path to it.
     
    techbongo, Aug 6, 2009 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    Originally Posted by Bohra View Post
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^techbongo.com/home [nc]
    rewriterule ^$ http://www.techbongo.com/ [r=301,nc]

    Now it will redirect to the main thing always
     
    Bohra, Aug 6, 2009 IP
  6. sarabvi

    sarabvi Peon

    Messages:
    127
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well you can use the following method as well...

    Make an "index.php" with the following code and upload it to your main domain.

    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.techbongo.com/home" );
    ?>
     
    sarabvi, Aug 6, 2009 IP