Page 1 of 1

stripping variable from a URL

Posted: Mon Oct 20, 2003 11:11 am
by obewan
http://www.xyz.com/index.php/toast

Can I easily strip the "toast" variable from this URL without using a "?". If not, is there a way to setup the server to use this format:

http://www.xyz.com/?toast

Right now, the above format returns an error since I'm not putting in the "index.php".

Thanks.

Posted: Mon Oct 20, 2003 11:19 am
by Kriek
The easiest way is with mod_rewrite in an .htaccess file:

Code: Select all

<IfModule mod_rewrite.c> 
  RewriteEngine on 
  RewriteRule ^index/(.*)/$ index.php?id=$1
</IfModule>
Then your link would be: http://example.com/index/toast/

Posted: Mon Oct 20, 2003 11:23 am
by qads
i was useing

http://www.mysite.com/folder/?bla=1

for a while, it worked fine...untill i tried it out with opera 8O, so now i use
http://www.mysite.com/folder/index.php?bla=1...

i dont really see any problem with adding "index.php"part to it :?.

Posted: Tue Oct 21, 2003 10:13 am
by obewan
Thanks.