...

View Full Version : 404 redirect to homepage .htaccess



Fred
01-30-2004, 02:01 AM
I am currently using this 404 redirect back to my homepage in my .htaccess under Linux/Apache

ErrorDocument 404 http://www.cyberserious.com

This works great, but I want to find out how I can set it up to retain any bad page URLs in the browser's address bar instead of removing them from my homepage URL, and works for all types of pages - php and html.

IE: If somebody attempts to go to a non-existent page like
http://www.cyberserious.com/xyz.html

I would like the redirect to retain the "/xyz.html" part when it redirects to

http://www.cyberserious.com

and continue to appear as http://www.cyberserious.com/xyz.html

in their browser's address bar, instead of bouncing to http://www.cyberserious.com

Reason: I want to protect my privacy from prying eyes who want to find out if I'm using php, asp, etc..
Fred

Spookster
01-30-2004, 04:44 PM
How would keeping a person on the bad page verses redirecting them to the homepage prevent them from finding out what kind of server side language you are using? If you want to disguise what language you are using there are easier ways of going about it. The most obvious way is to change the file extensions of all your PHP or ASP, etc pages to .htm or whatever and set up apache to handle all of those as PHP or ASP pages.

Fred
01-30-2004, 05:23 PM
Yes, I could do that, but the disadvantage there, is parsing all the html pages through the php engine puts a load on the server and slows down the entire site.

This is not a serious issue, but I did want to see if I can do it, since I saw other sites doing it.
Fred

Spookster
01-30-2004, 07:44 PM
Originally posted by Fred
Yes, I could do that, but the disadvantage there, is parsing all the html pages through the php engine puts a load on the server and slows down the entire site.

This is not a serious issue, but I did want to see if I can do it, since I saw other sites doing it.
Fred

Yes all pages would be parsed by the PHP engine but the difference wouldn't be very noticable.

If you don't like that idea then create your own extension for just the server side pages and just have apache send those pages to the PHP engine. If you have files like index.fred then they won't know what language you are using.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum