If someone enters the url mydomain.com/AAA I want it to redirect to mydomain.com?id=AAA
There is no folder called AAA
Any way to detect this other than using htaccess ?
Thanks
Redirect URL
Moderator: General Moderators
just a brainstorm here
perhaps make a custom 404 page (that will come up when they type in the URL that's not valid such as domain.com/AAA)
include a PHP script at the top of the 404 page, that uses a regex to determine what's after the / in the URL they entered. Then use a header("Location: page.php?var=$typedinurl");
Just an idea though, I have no clue if it would actually work.
perhaps make a custom 404 page (that will come up when they type in the URL that's not valid such as domain.com/AAA)
include a PHP script at the top of the 404 page, that uses a regex to determine what's after the / in the URL they entered. Then use a header("Location: page.php?var=$typedinurl");
Just an idea though, I have no clue if it would actually work.