|
|
|
|
![]() ![]() |
Apr 12 2008, 10:24 PM
Post
#1
|
|
|
Advanced Member Group: [HOSTED] Posts: 110 Joined: 12-April 08 Member No.: 29,760 |
Okay, I want to know how can I redirect any visitor that comes to my site to the forum automatically since that is all the site is. I should have just placed the Forum in the main directory, but it's too late now and I have no wish to redo it. So how do I redirect my site using htaccess from / to /forum/ (my site is at http://www.legallyhighforum.astahost.com/), I'm trying this script right now:
Redirect /index.php http://www.legallyhighforum.astahost.com/forum/index.php but it only redirects the index.php specifically to the forum/index.php, I need a full directory redirect script, so / will go to /forum/ This post has been edited by yordan: Apr 16 2008, 05:38 PM
Reason for edit: added the "solved" word in title
|
|
|
|
Apr 13 2008, 01:40 AM
Post
#2
|
|
|
Premium Member Group: Admin Posts: 320 Joined: 10-January 06 Member No.: 10,610 myCENTs:48.19 |
If htaccess is complicated to set up, try following simpler solutions.
Using a simple index in HTML HTML <META http-equiv="refresh" content="5;URL=http://www.domain.to.redirect/folder/optional"> content=5 means in 5 seconds. During which time you can display a short message "You're now being redirected to..." Save it as index.html or index.htm as you like. Using a simple index in PHP CODE <?php header('Location: http://www.domain.to.redirect/'); ?> Save it as index.php and you're redirecting. |
|
|
|
Apr 14 2008, 04:10 AM
Post
#3
|
|
|
Advanced Member Group: [HOSTED] Posts: 110 Joined: 12-April 08 Member No.: 29,760 |
Thank you for the advise sir, I was actually thinking of doing that, but didn't want to have any files in the / directory, I just wanted everything in the / directory to redirect to /forum/ However, I looked through Google and found out how to use Htaccess Redirects. I tried out the Htaccess script but I found out the Htaccess script only works for non Sub Domain websites (I am a sub domain of Astahost, until I get my own .com). Later I found out that Astahost's CPanel provided a redirect option, and wallah, Problem Solved. Any way's thanks for the suggestion though.
|
|
|
|
Apr 16 2008, 07:50 PM
Post
#4
|
|
|
Member - Active Contributor Group: [HOSTED] Posts: 92 Joined: 26-December 07 From: Venezuela Member No.: 27,134 |
maybe it is too late now, but this will probably help any other who has the same problem as you, and as I did before.
You can use a php redirection, just create a file and name it index.php and place it in your main directory, with this code: CODE <?php header( 'Location: http://www.yoursite.com/new_page.html' ); ?> But do not add any other type of code, for instance if you put an html tag before the code, it wouldn't work. So to keep it working, your safest bet is to simply remove all content from the page but the redirect code. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 23rd November 2008 - 06:28 PM |