Closed Thread Icon

Topic awaiting preservation: htaccess redirect functionality using php only? Pages that link to <a href="https://ozoneasylum.com/backlink?for=12801" title="Pages that link to Topic awaiting preservation: htaccess redirect functionality using php only?" rel="nofollow" >Topic awaiting preservation: htaccess redirect functionality using php only?\

 
Author Thread
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 06-28-2003 22:22

hi guys,

i need a way to get redirect any visitors who access a non-existent page on my site to a page that does exist - trouble the usual methods for doing this (error 404 docs or page redirects) require htaccess and my htaccess files can unfortunately contain nothing but 'DirectoryIndex' anything else causes a server error (I don't really want to go into this now, i did in a previous thread and reached no solution so just believe me, even tho it seems dumb or impossible that htaccess would behave this way).

So I need a php solution to redirect any 'mishits' to my homepage or an error page or whatever as long as it is a page that exists and not the crappy default 404 page that my host uses.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-29-2003 03:40

nope for php to work you need to be able to direct users to a script. Without using htaccess, or some other method for controlling how Apache directs requests can't send them to a script.



.:[ Never resist a perfect moment ]:.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-29-2003 13:23

the only alternative I see to a .htaccess would be piping *all* requests through a php script, like
yourdomain.com/page.php?p=index

but
a) all your urls would have to change
b) yourdomain.com/dontfindme would still cause a regular 404.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 06-29-2003 14:37

how does asp do it then? i seem to remember reading something about custom error pages with asp.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-29-2003 18:26

There are methods to do this without using htaccess, they're just probably not availible to you.

asp is run on IIS servers which doesn't have an htaccss file but it does have the same functionality.




.:[ Never resist a perfect moment ]:.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 06-29-2003 18:34

what other methods? i have pretty much everything except htaccess and iis.

« BackwardsOnwards »

Show Forum Drop Down Menu