how do I rewrite web requests of type http://mydomain.com/mypage.php?id=somenumber where somenumber is an integer TO http://mydomain.com/directory
like http://mydomain.com/mypage.php?id=15 to http://mydomain.com/directory
how do I rewrite web requests of type http://mydomain.com/mypage.php?id=somenumber where somenumber is an integer TO http://mydomain.com/directory
like http://mydomain.com/mypage.php?id=15 to http://mydomain.com/directory
Yeah, well, assuming the comment on your question is what you in fact want, you would do something like:
Somewhere on apache's config:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so On your .htaccess:
RewriteEngine On RewriteRule ^/directory/$ /mypage.php?id=something [NE,PT] This would make it so that when you open http://mydomain.com/directory/ it would serve exactly the same content as http://mydomain.com/mypage.php?id=something.
Edit: fixed typo on RewriteEngine and fixed the regexp too... was distracted.
Hope this helps you.
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so. Oh I see the problem now... editing answer :P RewriteEngine not Rewire hehe!