Unable to rewrite two urls to same folder with .htaccess
I am having a strange problem. I have an .htaccess file that will work
only if I make these these bottom two conditions/rewrites different
folders. I would like both the products.php and specs.php pages to show:
www.example.com/products/ followed by their respective slugs for pretty
URLs. As it stands now I can only get this to (kinda) work if I have
different folder names. Products.php shows a brief description of a number
of products in a category (After domain it would show /candy). The specs
pages shows only one product (After domain it shows product line and
product name candy/sweethearts). Any help would be greatly appreciated!
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
#products.php pages
RewriteCond %{THE_REQUEST} html/products.php
RewriteCond %{QUERY_STRING} ^slug=(.*)$
RewriteRule ^html/products\.php$ http://www.example.com/products/%1?
[R=301,L]
RewriteRule ^products/(.*)$ /html/products.php?slug=$1 [L]
#specs.php pages
#RewriteCond %{THE_REQUEST} html/specs.php
#RewriteCond %{QUERY_STRING} ^prodslug=(.*)$
#RewriteRule ^html/specspage\.php$ http://www.example.com/specs/%1? [R=301,L]
#RewriteRule ^specs/(.*)$ /html/specs.php?prodslug=$1 [L]
No comments:
Post a Comment