| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | How can I redirect my home page to another part of my site? Ok I am using Godaddy's hosting and my main domain is say lll.com. Well I installed joomla on it at lll.com/h. When people type in lll.com I need them to be redirected to lll.com/h. I was using a JavaScript code to do it with other sites but this site doesn't support Java. I can't simply forward the domain either because it will change the nameservers. What do I do? |
| |
| | #7 (permalink) |
| NamePros Member | .htaccess redirects or mod_rewrite are most definitely better options than meta refresh. Some devices don't support it and it can be blocked too....
__________________ Regards Jamie Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. |
| |
| | #8 (permalink) |
| NamePros Regular | here you go. This goes inside your .htaccess file: Redirect 302 /file.html http://www.example.com/new_file.html obviously, in the first case you don't include the domain, just the directory and filename, but in the second case you include the full one. making it a 302 means it's a temporary redirect, and changing that to 301 means it would be a permanent one. |
| |
| | #10 (permalink) |
| NamePros Regular | How do I do it because its not working. I put this by itself in a .htaccess file Redirect 301 /index.html http://www.example.com/h/ Then uploaded it to the main directory. What am I doing wrong? |
| |
| | #12 (permalink) |
| NamePros Member | Depending on what you have index already on your site, you probably want everything in your root directory to be directed to your h directory?? To do this try something like: Code: RedirectMatch permanent ^(.*)$ /h$1
__________________ Regards Jamie Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. |
| |
| | #14 (permalink) |
| NamePros Member | Oops, sirry. Untested. Perhaps putting another condition in your h directory would sort it. Or checking that h doesn't exist in your first comparison. Butanyway, glad you got it sorted.
__________________ Regards Jamie Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. |
| |
| | #15 (permalink) | |
| NamePros Regular | Quote:
| |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |