Hi all I followed the tutorial here: http://www.shadow-fox.net/site/tutorial/45-Create-Dynamic-URLs-With-Mod-Rewrite-and-PHP-Functions to create a rewrite rule so that http://blah/index.php?id=7&page=4 could be written http://blah/index//id/7/page/4/ for search engine friendliness, but it's not working. I wanted to use the double slash system because my site has all sorts of pages with parameters currently passed by the querystring, and I didnt want to have to write a rule for each, so by using the // I could ensure everything after that was a variable/value pair I have a Windows server running Apache, with the following .htaccess file in http://blah/foo/: RewriteEngine on RewriteRule (.*)//(.*) $1.php?parameters=$2 But using the URL http://blah/foo/index//id/10/ I get a 404 error. If I use RewriteEngine On RewriteRule index/(.*) index.php?parameters=$1 Then http://blah/foo/index/id/10/ works fine. Can anyone help me out with the correct expression to get // working? many thanks Lucas
Um, you don't want two //'s in a row. Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^index/id/([^.]+)/page/([^.]+)/$ index.php?id=$1&page=$2 [L]
OK, I was keen to have a generic way to deal wiht lots of different page names and parameters, ie index.php?id=7 detail.php?id=4&page=3 products.php?category=7 etc So I would need a rule for each one? cheers