NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page redirect 404

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 09-12-2004, 07:50 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Apr 2004
Posts: 1,189
e39m5 is a jewel in the roughe39m5 is a jewel in the roughe39m5 is a jewel in the rough
 



redirect 404


cpanel automatically sves as a .shtml. How can i redirect to my homepage iwth that extension?
e39m5 is offline  
Old 09-12-2004, 09:30 AM   #2 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
i take it you mean you want the shtml site to be the 1 it goes to if someone types in www.domain.com

if so simply do the following:-

creat a text document and put the following into it (changing page.shtml to whatever the page is called):-

Code:
DirectoryIndex page.shtml
save the file as .htaccess (note nothing before the .) and upload it into your root folder. If you want other pages to be default page if that 1 does not exist just put a space at the end and add the next name.
????: NamePros.com http://www.namepros.com/programming/47483-redirect-404-a.html

More info can be found at http://httpd.apache.org/docs/howto/htaccess.html
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 09-12-2004, 09:32 AM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: Apr 2004
Posts: 1,189
e39m5 is a jewel in the roughe39m5 is a jewel in the roughe39m5 is a jewel in the rough
 



if someone types in www.1320info.com/asdlhglksgakjdhg.html i want it to go to www.1320info.com/index2.php
e39m5 is offline  
Old 09-13-2004, 09:08 AM   #4 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



Originally Posted by e39m5
if someone types in www.1320info.com/asdlhglksgakjdhg.html i want it to go to www.1320info.com/index2.php
You can add this to your .htaccess file:

ErrorDocument 404 http://www.yourdomain.ext/pageyouwantredirectedto.html
deadserious is offline  
Old 09-15-2004, 04:02 PM THREAD STARTER               #5 (permalink)
Senior Member
Join Date: Apr 2004
Posts: 1,189
e39m5 is a jewel in the roughe39m5 is a jewel in the roughe39m5 is a jewel in the rough
 



heh, im a n00b at this, wheres the htaccess file?
e39m5 is offline  
Old 09-15-2004, 04:20 PM   #6 (permalink)
Senior Member
 
Scott's Avatar
Join Date: Jun 2003
Location: UK
Posts: 3,541
Scott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond repute
 

Member of the Month
February 2005

Originally Posted by e39m5
heh, im a n00b at this, wheres the htaccess file?
It's a file named ".htaccess" in your www directory (public_html for cPanel servers).
Scott is offline  
Old 09-16-2004, 12:52 PM   #7 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Originally Posted by deadserious
You can add this to your .htaccess file:

ErrorDocument 404 http://www.yourdomain.ext/pageyouwantredirectedto.html
if you do that I dont think the search engines will index the page as a header that will be sent will of 1 that a page does not exist.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 10-01-2004, 10:03 AM   #8 (permalink)
NamePros Regular
Join Date: Sep 2004
Location: Poland
Posts: 245
Michau is on a distinguished road
 



Use:

Code:
ErrorDocument 404 yourscript.php
And in yourscript.php:

Code:
<?php
header("HTTP/1.0 301 Moved");
header("Location: index2.php");
?>
This way you will get indexed by sarch engines because the PHP script will remove the 404 error code.
Last edited by Michau; 10-02-2004 at 03:36 AM.
Michau is offline  
Old 10-02-2004, 02:28 AM   #9 (permalink)
NamePros Regular
Join Date: Feb 2004
Posts: 720
Caveman has a spectacular aura aboutCaveman has a spectacular aura about
 



Originally Posted by Michau
Use:
????: NamePros.com http://www.namepros.com/showthread.php?t=47483

Code:
ErrorDocument 404 yourscript.php
And in yourscript.php:

Code:
<?php
header("HTTP/1.0 31 Moved");
header("Location: index2.php");
?>
This way you will get indexed by sarch engines because the PHP script will remove the 404 error code.
Nice Tip!
Caveman is offline  
Old 10-02-2004, 03:37 AM   #10 (permalink)
NamePros Regular
Join Date: Sep 2004
Location: Poland
Posts: 245
Michau is on a distinguished road
 



OOps, one little mistake Should be "HTTP/1.0 301 Moved", not "HTTP/1.0 31 Moved".
Michau is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:27 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger