NameSilo

How can I redirect my home page to another part of my site?

SpaceshipSpaceship
Watch

twells22

Established Member
Impact
0
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?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
You don't need Java to use JavaScript. JS is completely browser dependent, though, so another choice is still better.

You could add the following line of code to your site:
Code:
<meta http-equiv="REFRESH" content="0;url=http://www.lll.com/h">
 
0
•••
Thanks, that did it!
 
0
•••
another way is to do a 302 redirect via your .htaccess file... that way, it doesn't count as two page views... (one for the old one, one for the new one). let me know if you want to know how to do this.
 
0
•••
I'm always interested in learning. Sure!
 
0
•••
You can also use mod_rewrite to do the job.
 
0
•••
.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....
 
0
•••
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.
 
0
•••
Of course you could have just installed joomla in the site root, rather than a subdirectory. I don't suppose it would be too hard to move it (I don't know a think about joomla though)
 
0
•••
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?
 
0
•••
does your htaccess file begin with:

<IfModule mod_rewrite.c>
RewriteEngine On

because i believe that's how it's supposed to begin.
 
0
•••
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
 
0
•••
jabba*
When I did that it sent everything to example.com/h/h/h/h/h/h/h/h/h/h/

But I got it to work with groundcntrl's tip. Thanks
 
Last edited:
0
•••
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.
 
0
•••
Mikor said:
Of course you could have just installed joomla in the site root, rather than a subdirectory. I don't suppose it would be too hard to move it (I don't know a think about joomla though)
Yea but I like to organize my files to where its easier for my to modify them with ftp. I have more than one site on this hosting account and it helps me to do it this way.
 
0
•••
Does this work if you request /index.html as opposed to /? The redirect is handled before the default document directive is looked at...

Also, are you certain your server is configured with all the modules enabled needed to do this?
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back