Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Help With Redirect [solved]
LegallyHigh
post Apr 12 2008, 10:24 PM
Post #1


Advanced Member
Group Icon

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
Go to the top of the page
 
+Quote Post
BuffaloHELP
post Apr 13 2008, 01:40 AM
Post #2


Premium Member
Group Icon

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.
Go to the top of the page
 
+Quote Post
LegallyHigh
post Apr 14 2008, 04:10 AM
Post #3


Advanced Member
Group Icon

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.
Go to the top of the page
 
+Quote Post
mikesoft
post Apr 16 2008, 07:50 PM
Post #4


Member - Active Contributor
Group Icon

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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Running Shell Script And Redirect To Log File?(4)
  2. Problem Accessing My Cpanel(9)
  3. JavaScript Off Redirect Script(2)
  4. Router Safety(2)
  5. Website Down(1)
  6. Bid For Power Opengl Error [solved](6)
  7. Administrator Account Problem In Microsoft Xp [solved](20)
  8. Apache Php With Mysql On Windows [solved](9)
  9. Writing And Testing My Own Login Script [solved](20)
  10. Html Table Rows Problem [solved](1)
  11. Need To Edit A Wav File [solved](1)
  12. 3 Weeks :/ [solved](8)
  13. Boot Error On Customized Kernel [solved](2)


 



- Lo-Fi Version Time is now: 23rd November 2008 - 06:28 PM