I used to pay people to write these tiny rewrite lines for me but I really want to learn it now. Most rewrite examples and tutorials only use 1 query string or simply dont work. I yet have to find out how to use mod_rewrite to move .php?first=x&second=y&third=z to a static version.
http://nanoweb.si.kz/manual/mod_rewrite.html There are lots of ways to use rewrites. The more complex looking rules are usually built to handle many situations and are more efficient for the server vs. having lots of different specific rules which may be easier to write but put more strain on the server. Starting out it is often easier to make very specific rules until you feel more comfortable with regular expressions. For your example ... A possible solution could be: RewriteRule ^(.+)/first-(.*)/second-(.*)/third-(.*) $1.php?first=$2&second=$3&third=$4 You would change your app to generate URLs that look like so to use this rule: www . yourdomain.com/anysubdirectories/anyphpfilename/first-x/second-y/third-z where "anyphpfilename" would be a php filename without the .php extension.
Cheers Mr Virginia Realtors....Been looking for a simple tutorial which actually explains what syntax is available but everything I have seen seems very complex and doesn't cover the basics. For anyone else readin this and interested in the mod_rewrite solution on a hosted server (i.e. owned by another company) I think the simplest way to test is add this line to your .htaccess RewriteEngine On RewriteRule ^test.php /apagethatexists.php [L] Code (markup): Make a back up first though So if you had a link in your site pointing to test.php (which doesn't really exist) your browser open apagethatexists.php instead. Is using this to make my URL looks static likely to improve my position in google though because I understand it can handle dynamic URLs and other search engines are on the way. Anyone have any thoughts on this?