Serpes Serpes - 3 months ago 5
Apache Configuration Question

htaccess URL rewrite is not working in production but works on local

I have a problem with URL rewritting and htaccess. I have an URL like

www.example.com/index.php?fc=module&module=mymodule&controller=name&id=35
but it's too complex for people so I want to change it. I created a directory in my host like
example.com/web/title-for-name/
where I put this .htaccess:

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php?fc=module&module=mymodule&controller=name&id=35$1 [L,NC]


I've tested it in my local and it seems to work but when I test it in production it just redirect me changing my URL. Mod-rewrite is enabled because my web is rewriting other URLs. Also
AllowOverride
is set to
All
. The main difference between my local and production is that I'm not using Varnish.

Answer

I've solved this problem. There was an URL rewrite before mine that changed the domain .es to .com and changed the rest of my URL so I just changed the link I use to the .com domain.

Thanks everyone.

Comments