Hi DP friends, Currently I am trying to make SEF URLs for the following project aidability.co.uk, however I have major problems with rewriting URLs through .htaccess. Probably I have to mention that website is hosted at 1&1, can anybody help me with some very basic .htaccess . Currently my .htaccess file looks like that: RewriteEngine On RewriteRule ^([^/]*)\.html$ /index.php?pagelink=$1 [i] RewriteRule ^([^/]*)\.html$ /category.php?category=$1 [c] RewriteRule ^([^/]*)\.html$ /product_detail.php?product=$1 [d] Code (markup): Kind regards Kal
Well... you have set all url rules to the same value, so each time your first rule will be applied. You might want to change your second and third rule, so each gets a little bit different. For example: RewriteEngine On RewriteBase / RewriteRule ^([^/]+).html$ /index.php?pagelink=$1 [L] RewriteRule ^category/([^/]+).html$ /category.php?category=$1 [L] RewriteRule ^product/([^/]+).html$ /product_detail.php?product=$1 [L] Code (markup): So, with this three rules, all your html links will actually open index.php page, all your category/somepagehere.html will open your category.php and all your product/blahblah.html will open product_detail.php script. You can of course change the code the way you like it, but remember that each rule has to be somehow specific, and not the same as another rewrite rule, because the server will then apply the first one it finds in htaccess. Cheers!