Forum Moderators: phranque
I am hoping someone here can help me. I have been googling quite a bit this morning looking for a solution but nothing is catching my eye.
I have this in my .htaccess located in a demo folder:
RewriteEngine On
# Rewrite static URLs to dynamic
rewritecond %{REQUEST_URI} !^(/demo/products/)
rewritecond %{REQUEST_URI} !^(/demo/categories/)
rewritecond %{REQUEST_URI} !^(/demo/articles/)
# uncomment the above line if you have the article add-on installed
RewriteRule (.*)\.htm$ /demo/proddetail.php?prod=$1
rewritecond %{REQUEST_URI} ^/demo/categories/
RewriteRule ^/demo/categories/([^.]+)\.htm$ /demo/categories.php?cat=$1
rewritecond %{REQUEST_URI} ^/demo/products/
RewriteRule ^/demo/products/([^.]+)\.htm$ /demo/products.php?cat=$1
#rewritecond %{REQUEST_URI} ^/demo/articles/
#RewriteRule ^/demo/articles/([^.]+)\.htm$ /demo/viewarticle.php?artid=$1
# uncomment the above 2 lines if you have the article mod installed
# Redirect only client-requested dynamic URLs to static
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /demo/proddetail\.php\?prod=([^&]+)\ HTTP/
RewriteRule ^/demo/proddetail\.php$ [mysite.com...] [R=301,L]
If it I remove /demo/ throughout the .htaccess and move it to the primary folder it works great, but no matter what I can't get it to work from within the demo folder. It is sending all .htm requests to /demo/proddetail.php so it seems to me that it is ignoring the rewrite conditionals set above that.
I am just hoping someone here will see my mistake :)
Thanks,
Stewart
RewriteConds testing REQUEST_URI) *will* see the leading slash, but many of your RewriteConds are redundant because they test the same URL-path as the following RewriteRule. You can get rid of those redundant RewriteConds.
Jim