Help With Redirect [solved]

free web hosting
Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

Help With Redirect [solved]

LegallyHigh
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/

Reply

BuffaloHELP
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.

Reply

LegallyHigh
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.

Reply

mikesoft
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.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : redirect solved


    Looking for redirect, solved,

Searching Video's for redirect, solved,
advertisement




Help With Redirect [solved]



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE