cballin Posted January 25, 2007 Share Posted January 25, 2007 Hi, every one. I would like to know how to redirect my home page to my oscemmecre page. for example. when people type in my web address - http://mywebsite.com it takes them to http://mywebsite.com/oscommerce/ (My oscommerce catalog page). Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
CTO Posted February 28, 2007 Share Posted February 28, 2007 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 More sharing options...
CTO Posted February 28, 2007 Share Posted February 28, 2007 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 More sharing options...
Guest Posted April 25, 2007 Share Posted April 25, 2007 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 More sharing options...
jeellison Posted April 30, 2007 Share Posted April 30, 2007 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 More sharing options...
ErollorD Posted April 30, 2007 Share Posted April 30, 2007 post us your index.php file... Link to comment Share on other sites More sharing options...
Guest Posted April 30, 2007 Share Posted April 30, 2007 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 More sharing options...
jeellison Posted April 30, 2007 Share Posted April 30, 2007 All working now with the php thanks. I did originally try with my CP but it wouldnt work. Cheers James Link to comment Share on other sites More sharing options...
breamillman Posted May 13, 2007 Share Posted May 13, 2007 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 More sharing options...
mtechama Posted May 13, 2007 Share Posted May 13, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.