RE: 404 Not Found -> refresh to directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Terry Romine <mailto:terry_romine@xxxxxxxxxxxxx>
    on Thursday, July 14, 2005 1:52 PM said:

> I have a website that has several hundred agents in a mysql database.
> The client wants to be able to enter the domain.com/agentname and be
> redirected to a standard page where we show the agent information.

[snip/]

> I think my question is: is there an easy way to use a 404 page
> written in php to capture the parameters from the missing page
> request and test against a db, resulting in either a valid page
> redirect or a not found redirect?   

Never tried it, but this is super easy to do with mod_rewrite and
.htaccess.

## DEFINE REWRITE RULES
RewriteEngine on
RewriteRule ^([\w-]+)$ yourpage.php?agent=$1


Should work (maybe).


Chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux