#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    301 Redirect - Joomla


    Hi,

    I have the following problem:

    I have a joomla 1.1.15 website that is clearly obsolete, and it is in a subfolder. It has non sef urls that are indexed by google.

    In the root i have joomla 2.5 with good urls. All i want is to redirect all traffic from the subfolder (all the non sef urls) to the root.

    I have partially done it with a redirect from subfolder to root with:

    Code:
    RewriteRule ^subfolder\?$ "http\:\/\/www\.my\-web\.com\/" [R=301,L]

    But that code does not redirect all other pages i.e.

    Code:
    www.my-web.com/subfolder/index.php?option=com_content&task=view&id...

    I am strugling to find a correct solution that would point all those index.php links from my subfolder site to the new root site.

    This is how the part of custom redirects in my .htaccess looks like:


    Code:
    ## Begin - Custom redirects
    #
    RewriteRule ^subfolder\?$ "http\:\/\/www\.my\-web\.com\/" [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?\ HTTP/
    RewriteRule ^(([^/]+/)*)index\.html?$ http://www.my-web.com/$1 [R=301,L]
    #
    RewriteCond %{THE_REQUEST} !^POST
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
    RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
    RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.my-web.com/$1 [R=301,L]
    #
    RewriteCond %{HTTP_HOST} !^(www\.my-web\.com)?$
    RewriteRule (.*) http://www.my-web.com/$1 [R=301,L]
    #
    ## End - Custom redirects
    With respect,
    nis4
  2. #2
  3. Busting SEOChat Spammers!
    SEO Chat High Scholar (3500 - 3999 posts)

    Join Date
    Jul 2009
    Location
    UK - Kent - Maidstone - PC!
    Posts
    3,754
    Rep Power
    1476
    Hi nis4,

    This would be the easiest code to use:
    Code:
    RewriteRule ^old/(.*)$ http://www.domain.com/new/$1 [R=301,L]
    You can view some more basic htaccess code from the links in my sig if you need to see how to do any other redirects
    New To SEOChat? See Here & the FAQ's

    "stupid people say stupid things, and smart people out smart each other!" SOAD
    301 Redirects | SEO Tools | Default htaccess | CuteRank
  4. #3
  5. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0
    Hi NathanlelB,

    First off, thank you for the extremly quick reply.

    I tried your solution, but it is not working for me. I am not redirecting from subfolder to subfolder, but from subfolder to root.

    After trying your code, the old links show me a "website unavailable page" instead of redirecting to my root.
    The subfolder is redirecting correctly, but not the urls that are with it, that start with: "old/index.php..."

    Code:
    www.my-web.com/subfolder/index.php?option=com_content&task=view&id...
    I am having headaches from this problem :/
  6. #4
  7. Busting SEOChat Spammers!
    SEO Chat High Scholar (3500 - 3999 posts)

    Join Date
    Jul 2009
    Location
    UK - Kent - Maidstone - PC!
    Posts
    3,754
    Rep Power
    1476
    It should work the same if you remove /new from the code?

    Another option would be to use:
    Code:
    RedirectMatch 301 ^/old/$ http://domain.com/
    Which would be the better option come to think of it
  8. #5
  9. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0
    Yep i did removed the /new in the example before.

    The second option you did works, but only for the subfolder /old
    Still not for the links (articles) in it. They are now available, so basicly i have 2 sites now.

    I would like to point out that the .htaccess is only in the root, i deleted the one from the subfolder.

    I tryed also with a index.html in the subfolder, but the same result, it only redirected the subfolder, not the links in it.

    Is there a variable to add to the subfolder that will automaticly redirect /old/index.php...... links to the root?
  10. #6
  11. Busting SEOChat Spammers!
    SEO Chat High Scholar (3500 - 3999 posts)

    Join Date
    Jul 2009
    Location
    UK - Kent - Maidstone - PC!
    Posts
    3,754
    Rep Power
    1476
    It should do the trick, have you tried Ctrl+F5 on the page?

    If that don't work try the following:
    Code:
    RedirectMatch 301 ^/old/$ http://domain.com/$
    Again, make sure to hard refresh your page's' and even try it in a different browser.

    Also I take it you do have this at the beginning of your .htaccess?
    Code:
    RewriteEngine On
    RewriteBase /
    Here's the full code you should using (try without and with the last $ if it don't work)
    Code:
    RewriteEngine On
    RewriteBase /
    # Redirects all from /old to respective url on root
    RedirectMatch 301 ^/old/$ http://domain.com/$
  12. #7
  13. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0
    Yep i did try different browsers and ctrl + f5. Below is my full .htaccess.

    I don't have a .htaccess in subfolder, is that ok? (i deleted it). I only have it in the root.

    Is there a .php redirect, that i could insert in .index.php in the subfolder?
    Last edited by nis4; Feb 14th, 2013 at 01:33 AM.

Similar Threads

  1. Important: Technical 301 Redirect question (revamp from html to joomla)
    By web2seo in forum Search Engine Optimization
    Replies: 1
    Last Post: Nov 8th, 2012, 08:36 PM
  2. Need help in SEO for Joomla
    By resaik_king in forum Search Engine Optimization
    Replies: 0
    Last Post: Mar 12th, 2009, 12:49 PM
  3. Joomla and SEO
    By evmikna in forum Search Engine Optimization
    Replies: 5
    Last Post: Dec 17th, 2006, 01:04 AM
  4. Joomla SEO?
    By MABDesign in forum SEO Help (General Chat)
    Replies: 2
    Last Post: Jan 18th, 2006, 03:49 AM

IMN logo majestic logo threadwatch logo seochat tools logo