Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Redirect 404

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

e39m5

Established Member
Impact
9
cpanel automatically sves as a .shtml. How can i redirect to my homepage iwth that extension?
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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.

More info can be found at http://httpd.apache.org/docs/howto/htaccess.html
 
0
Close
0
Close
0
Close
heh, im a n00b at this, wheres the htaccess file?
 
0
Close
e39m5 said:
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).
 
0
Close
0
Close
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:
0
Close
Michau said:
Use:

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!
 
0
Close
OOps, one little mistake :( Should be "HTTP/1.0 301 Moved", not "HTTP/1.0 31 Moved".
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back