Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

redirect home page


cballin

Recommended Posts

  • 1 month later...

For a php site, my favorite redirect method is to make this simple change:

(1) create a file index.php in the needed directory (your webroot in this case) with

<?php

header( 'Location: http://www.mywebsite.com/oscommerce/catalog/index.php' ) ;

?>

 

Advantages:

- you can always change it later

- it works in ALL browsers

- it doesn't look malicious to surfers

- it is supported by robots that might skip other redirect methods

- it works with the back button

- it retains the original url in the browser address bar

Link to comment
Share on other sites

Also,

If your webserver doesn't automatically open an index.php file in your needed directory (the webroot in this example),

(2) create a .htaccess file with this 1 line in it or add this 1 line to an existing .htaccess file:

 

.htaccess

directoryindex index.php

Link to comment
Share on other sites

  • 1 month later...

This works great. Thanks!

 

For a php site, my favorite redirect method is to make this simple change:

(1) create a file index.php in the needed directory (your webroot in this case) with

<?php

header( 'Location: http://www.mywebsite.com/oscommerce/catalog/index.php' ) ;

?>

 

Advantages:

- you can always change it later

- it works in ALL browsers

- it doesn't look malicious to surfers

- it is supported by robots that might skip other redirect methods

- it works with the back button

- it retains the original url in the browser address bar

Link to comment
Share on other sites

Hi,

 

When I use that code I get a:

 

Warning: Cannot modify header information - headers already sent by (output started at D:\site.co.uk\wwwroot\index.php:9) in D:\site.co.uk\wwwroot\index.php on line 10

 

Cheers

James

Link to comment
Share on other sites

Hi,

 

When I use that code I get a:

 

Warning: Cannot modify header information - headers already sent by (output started at D:\site.co.uk\wwwroot\index.php:9) in D:\site.co.uk\wwwroot\index.php on line 10

 

Cheers

James

 

 

In your case you could use the redirect function in your cPanel.

Link to comment
Share on other sites

  • 2 weeks later...
For a php site, my favorite redirect method is to make this simple change:

(1) create a file index.php in the needed directory (your webroot in this case) with

<?php

header( 'Location: http://www.mywebsite.com/oscommerce/catalog/index.php' ) ;

?>

 

Advantages:

- you can always change it later

- it works in ALL browsers

- it doesn't look malicious to surfers

- it is supported by robots that might skip other redirect methods

- it works with the back button

- it retains the original url in the browser address bar

 

 

Hey cool-- thanks! this worked for me when I completely changed to new domain name for just my store. Needed to redirect anyone that went to old store location within a completely different domain name- and this worked!

I just deleted and replaced my old cat/index file with this 1 line.

awesome- thanks!

Link to comment
Share on other sites

Hey cool-- thanks! this worked for me when I completely changed to new domain name for just my store. Needed to redirect anyone that went to old store location within a completely different domain name- and this worked!

I just deleted and replaced my old cat/index file with this 1 line.

awesome- thanks!

 

 

Ok here is what you need. make an index.html page like this code

 

<html>
<head>
<title>A web page that points a browser to a different page after 2 seconds</title>
<meta http-equiv="refresh" content="2; URL=http://www.pa.msu.edu/services/computing/">
<meta name="keywords" content="automatic redirection">
</head>
<body>
If your browser doesn't automatically go there within a few seconds, 
you may want to go to 
<a href="http://www.pa.msu.edu/services/computing/">the destination</a> 
manually.
</body>
</html>

Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...