+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: redirecting?!?

  1. #1
    Alumnus
    Join Date
    Sep 2011
    Posts
    119

    Default redirecting?!?

    hello all,
    I want to redirect this url http://www.superwoodltd.co.uk/joomla1/index.php?lang=en
    to this url www.superwoodltd.co.uk

    this is the code that I wrote in .htaccess file

    RewriteEngine on
    Options +FollowSymlinks -MultiViews

    RewriteCond %{HTTP_HOST} ^www.superwoodltd.co.uk$
    RewriteRule ^$ http://www.superwoodltd.co.uk/joomla1/index.php?lang=en [L,R=301]

    can any one tell me, why this is not working?
    it gives me error 403

    thanks
    Last edited by hn112; 8th Jun 2012 at 10:27 am.

  2. #2

    Default

    You have the Condition and Rule the wrong way round. The joomla URL is the condition and the rule is what you are rewriting. You also should account for the with and without "www".

    HTML Code:
    RewriteCond %{HTTP_HOST} ^superwoodltd\.co\.uk\/joomla1\/index.php?lang=en$
    RewriteRule ^$ http://www.superwoodltd.co.uk/ [L,R=301]
    Something like the above should work although obviously I can't test this - I'm not a REGEX expert!.

    Bear in mind also that this is NOT a redirect, it's a rewrite of the URL - the two things are not the same - be sure this is what you want to do.
    Perhaps late-night surfing is not such a waste of time after all: it is just the Web dreaming. Tim Berners-Lee
    Currently listening to: The Lion's Roar by First Aid Kit

  3. #3
    Alumnus
    Join Date
    Sep 2011
    Posts
    119

    Default

    thank you David, I tried your code
    but still I have problem, it is not solve yet

    the website is in "joomla1" folder, and I put the .htaccess file near that folder. (I didn't put the .htaccess file in joomla1 folder)

    the reason that I want to use this code is, I don't want to see the long URL for the home page of the site.
    I just want to type the domain name.
    I found another solution for that but I am not happy with it.

    this is the other solution: make an index.html in the root folder and type this code


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>SuperWood</title>
    <meta http-equiv="REFRESH" content="0;url=http://www.superwoodltd.co.uk/joomla1/index.php?lang=en"></HEAD>
    </HTML>

  4. #4

    Default

    The "refresh" redirect (although it works) is not a good option, particularly bad for SEO.

    The best option would be to move Joomla to the site root. Is this not possible?
    Perhaps late-night surfing is not such a waste of time after all: it is just the Web dreaming. Tim Berners-Lee
    Currently listening to: The Lion's Roar by First Aid Kit

  5. #5
    Alumnus
    Join Date
    Sep 2011
    Posts
    119

    Default

    I didn't install joomla there, the hosting company doesn't support Joomla, so they asked them to install it for them in their host, and the company install it in that folder.

  6. #6

    Default

    Sometimes you have to take the pragmatic view. It sounds like you don't have full access to this server, so you are limited to what you can do. Looking at the site now, I can see that there are no SEO friendly URLs on any part of the site anyway. Why bother changing the one on the homepage?
    Perhaps late-night surfing is not such a waste of time after all: it is just the Web dreaming. Tim Berners-Lee
    Currently listening to: The Lion's Roar by First Aid Kit

  7. #7
    Alumnus
    Join Date
    Sep 2011
    Posts
    119

    Default

    I have the access to the server but I can not install joomla on it. so you think that there is no solution!
    I though maybe I can solve the URL problem with .htaccess

  8. #8

    Default

    It depends on the nature of the "problem". Is it purely cosmetic/SEO or are there practical problems that mean the site does not function as required?
    Perhaps late-night surfing is not such a waste of time after all: it is just the Web dreaming. Tim Berners-Lee
    Currently listening to: The Lion's Roar by First Aid Kit

  9. #9
    Alumnus
    Join Date
    Sep 2011
    Posts
    119

    Default

    the problem is without that index.html and refreshing method, the main domain is not working. I was trying to take that index.html and replace it with .htaccess solution.

  10. #10

    Default

    I wouldn't bother. You're looking for a perfect solution to resolve an imperfect situation. Stick with what you have now because it works. The perfect solution is to install Joomla in the root folder and since you can't do that, an imperfect solution will do.

    What is your role on this project?
    Perhaps late-night surfing is not such a waste of time after all: it is just the Web dreaming. Tim Berners-Lee
    Currently listening to: The Lion's Roar by First Aid Kit

+ Reply to Thread

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