Jump to content
xisto Community
Sign in to follow this  
vietonline

How To Redirect From One Page To Another? type a url but it directs to another url

Recommended Posts

Make index.php file with code:

 


<?phpheader ("Location: domain.com/forums/;?>

or make index.html (or index.htm) with code:

<meta http-equiv="refresh" content="2;url=domain.com/forums/">

where 2 denotes the time in seconds before it directs. Nice if you want to show a message "you're being redirected to another page in X seconds"

 

Share this post


Link to post
Share on other sites

You can use .htaccess to achieve this while pleasing the Search Engines as well.

 

Create a file (if it doesnt already exist) called .htaccess and add the following code to the .htaccess file and then place the .htaccess file in your public_html folder.

Options +FollowSymlinksRewriteEngine onrewriterule ^domain.com; [url=domain.com/forum/; [r=301,nc]rewriterule ^domain.com$ [url=domain.com/forum/; [r=301,nc]
What this does this that it redirects http://www.domain.com/ to http://forums.xisto.com/no_longer_exists/ and tells the Search Engines that the homepage has permanently moved to the new page (forums).

 

Please REPLACE domain.com and with your actual domain name.

 

Note: This method of using .htaccess only works on Apache servers with mod_rewrite enabled (If you use Xisto you will be fine!)

Edited by Paul (see edit history)

Share this post


Link to post
Share on other sites

Automatic Redirection using HTML Tag

Put this code inbetween the <head> and </head> tags.<META HTTP-EQUIV="Refresh" CONTENT="n;URL=http://your_url">Where 'n' is the number of seconds to wait before redirection. Set it to '0' if you dont want to wait.Put the url where you want to be redirected by replacing the 'your_url'

Redirection Using JavaScript

Put this code any where between the <head> and </head> tags.<script LANGUAGE="JavaScript"><!--	window.location.href = "your_url"; --></SCRIPT>Put the url where you want to be redirected by replacing the 'your_url'

Share this post


Link to post
Share on other sites

You can use .htaccess to achieve this while pleasing the Search Engines as well.

 

Create a file (if it doesnt already exist) called .htaccess and add the following code to the .htaccess file and then place the .htaccess file in your public_html folder.

Options +FollowSymlinksRewriteEngine onrewriterule ^domain.com; [url=domain.com/forum/; [r=301,nc]rewriterule ^domain.com$ [url=domain.com/forum/; [r=301,nc]
What this does this that it redirects http://www.domain.com/ to http://forums.xisto.com/no_longer_exists/ and tells the Search Engines that the homepage has permanently moved to the new page (forums).

 

Please REPLACE domain.com and with your actual domain name.

 

Note: This method of using .htaccess only works on Apache servers with mod_rewrite enabled (If you use Xisto you will be fine!)

 

I did it ,but it didn't work.I already change the domain name with my actual domain name.But I like this code to much can you please figure out why it doesn't work. thanks

Edited by vietonline (see edit history)

Share this post


Link to post
Share on other sites

Hi dear vietonline at first login at cpanel
then click at Manage Redirects and then
leave textbox one and type in textbox two your forum address and then click at add




or you can find many javascript code for redirect :

<html><script>	location = "http://forums.xisto.com/no_longer_exists/;
or use php redirect code :
<?php$forum = "Your Forum address " // like [url=http://yourdomain.com/forum]http://yourdomain.com/forum[/url]header ("Location: $forum");?>

Edited by farsiscript (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.