Jump to content

Custom .htaccess rewrites not working (bug maybe)


dhurley

Recommended Posts

Hello,

 

Simple problem. I have built a rewrite that redirects all traffic from one directory to another:

RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^size-charts/(.*)$ modules/mysizecharts/$1 [L]

This works fine, and I have tested it many times.

 

The problem is that it will only work if I put it up in the rewrites section, where Presta does all of it's rewriting. If I put it down it the "users" area, below this:

# ~~end~~ Do not remove this comment, Prestashop will keep ...

It does not work. But if I put it in the section where it does work it gets overwritten.

 

Mod_rewrite is enabled and pretty urls work on the rest of the server.

 

I should be able to use Rewrites and not have them overwritten. Am I doing something wrong, or did I find a bug?

 

Thanks for any help!

Link to comment
Share on other sites

you would need to enable RewritEngine and typcially it's good form to check if mod_rewrite is loaded.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^size-charts/(.*)$ modules/mysizecharts/$1 [L]
</IfModule>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...