I currently have this on my .htaccess file So that will produce www.domain.com/url.html Now I want to add this... So that will produce www.domain.com/buy/something BUT when I combine everything in one .htaccess file I'm getting an infinite loop on my website... Any idea how to fix this? Any help will be greatly appreciated. Thanks
I don't see what is causing the infinite loop, but try this: Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule (.+)\.html$ index.php?page=$1 [L] RewriteRule ^buy/([^/]+)/?$ index.php?page=buy&catname=$1 [L] Also, why are using .html extensions, why not just get rid of it altogether? e.g. domain.com/buy, domain.com/buy/item Which would be: Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^buy/([^/]+)/?$ index.php?page=buy&catname=$1 [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ index.php?page=$1 [L]
Thanks for the reply. I got help from another forum and fixed it using the code below... As for your question, there's really no specific reason why I'm using .html extension, its just I started using .html extension on my old pages and I don't really want to replace those with the new URL format... Thanks again!