Forum Moderators: phranque
Options +FollowSymLinks
Options -Indexes
RewriteEngine On
rewritecond %{QUERY_STRING} ^cat=1&scat=12&sku=(sample-sku1|sample-sku2|sample-sku3)$
rewriteRule ^products/index.php$ /sample-landing-page.php/ [R=301,L]
Note: Pattern matching in per-directory context
Never forget that Pattern is applied to a complete URL in per-server configuration files. However, in per-directory configuration files, the per-directory prefix (which always is the same for a specific directory) is automatically removed for the pattern matching and automatically added after the substitution has been done.
I have redirects and rewrite rules in multiple htaccess files throughout different directories. The redirect rules work but I can't get the rewrites to work outside of the root level htaccess.
<snip>
[R=301,L]
I am trying to switch all Redirect 301s
Answering my own question, this works:
RewriteRule ^example\.html? /products/example/ [R=301,L]
RewriteRule ^example\.html? http://example.com/products/example/ [R=301,L]
http://example.com/somepage.html will be redirected to http://example.com/products/somepage/ http://www.example.com/somepage.html will be redirected to http://www.example.com/products/somepage/