zethon Posted June 10, 2006 Posted June 10, 2006 Some sites create dynamic urls, like perhaps http://www.foo.com/cow'>http://www.foo.com/cow Where "cow" is not a file or a directory, but is redirected and the page is dynamically generated. I've looked in the usual places, but I can't figure out how this is done. If someone type's http://www.foo.com/cow , and I'm foo.com, how would I get that redirected to, say, http://www.foo.com/script.php?id=cow ? I think the answer lies in the .htaccess file, but I'm not sure. help? Quote
TCH-Andy Posted June 10, 2006 Posted June 10, 2006 Welcome to the forums zethon You are correct, it's done in the .htaccess You can either do a single redirect >redirect 301 /cow http://www.foo.com/script.php?id=cow or a general redirect (in this case, for all files except "elephant" >RewriteEngine on RewriteBase / # don't rewite for elephant RewriteCond %{REQUEST_URI} !^/elephant # rewrite for eveything else ... RewriteRule ^(.*) /script.php?id=$1 [L] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.