So, I have a rewrite rule that is supposed to redirect an old URL to a new one:

RewriteRule ^(.*)/-/manufacturers/(.*)$ $1/manufacturers--$2 [R=301,NC]

This is located in the .htaccess for the domain (though I've tested it in the /pub/.htaccess as well with no luck). However, when this rule is present in the .htaccess file, the URL doesn't become domain.com/category/manufacturers--name.html. Instead, it becomes domain.com/pub/category/manufacturers--name.html.

Where am I supposed to set up rewrite rules if not in the domain's root .htaccess?

Update: I've determined that the rule is due to the line, "RewriteRule .* /pub/$0 [L]" For some reason, any rewrite above it gets /pub/ prepended. I can set up a rewrite condition for the /pub/ rule, but that is a workaround, and doesn't seem like a proper fix. The Magento documentation doesn't mention any new ways of using your own htaccess file in a manner that is compatible with their new directory structure. Seems like a huge change to push in an update without considering basic issues like this - issues that are baked into how people typically use htaccess files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.