Hi folks, I know this ain't php, but seemed the best place to put it for now.
Am trying to mod_rewrite the following:
http://www.nu.wetwork.org.uk/index.php?adran=first&tud=second
to
http://www.nu.wetwork.org.uk/first/second/
I'm a complete idiot when it comes to regex/apache, so any advice would be welcome. I have already managed to place 2 rules which:
1) renames nu.wetwork.org.uk to www.nu.wetwork.org.uk
2) gets rid of www.nu.wetwork.org.uk/index.php (and the index.html) to www.nu.wetwork.org.uk/
The second works OK as long as there is no querystring. Here's my ham-fisted attempt so far:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^nu.wetwork\.org\.uk
RewriteRule ^(.*)$ http://www.nu.wetwork.org.uk/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php|html)\ HTTP
RewriteRule ^(.*)index\.(php|html)$ /$1 [R=301,L]
In my test site, each page is referenced via index.php and querystring (always the 2 parameters). The faux-folders are just to give the site some structure / 'bookmarkability' for the user.
Thanks,
Ben.