Page 1 of 1

url rewriting

Posted: Fri Jan 07, 2011 6:41 am
by ronipthomas
Hi guys..

I want to rewrite my url from http://www.exmpl.com/foo/bar/test/123/ to http://www.exmpl.com/foo/bar/test.php?id=123...

I read many tutorials..

In that they all say about url's like http://www.exmpl.com/foo.php?id=123..

Please help me..
Please post a .htaccess sample file which does this, if possible.
Thanks in advance..

Re: url rewriting

Posted: Fri Jan 07, 2011 7:46 am
by josh
RewriteEngine On
RewriteRule /foo/(.*?) /foo.php?id=$1

now /foo/1 will be rewritten to /foo.php?id=1

First you must understand regex to understand rewrites.

Re: url rewriting

Posted: Wed Jan 12, 2011 10:07 am
by pickle
Moved to "Installation and Configuration".