You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by M A P <ma...@gmail.com> on 2017/03/02 02:16:18 UTC

[users@httpd] RewriteRules with Prestashop and Drupal

Hello,
2 separate needs for 2 web sites...

1) a prestashop 1.6 catalog. The owner asked to change the domain name 
of the site but wanted to keed the old one for legacy purpose... so 
www.olddomain.com <http://www.olddomain.com> became www.newdomain.com 
<http://www.newdomain.com>  We did a rewriterules :

RewriteRule ^(.+)/$ http://www.newdomain.com/$1 [R=permanent]

This is working fine when typing "www.olddomain.com 
<http://www.olddomain.com>" it is converting to "www.newdomain.com 
<http://www.newdomain.com>"  but if we try to access a specific link: 
"www.olddomain.com/index.php <http://www.olddomain.com/index.php>" this 
is what we get: "www.newdomain.comindex.php"
and of course, error. The /  is missing. I tried several version :
^/(.+)$
^(.*)/$
^(.+)$

always the same results! No / after the .com

We use a vhost.conf file for all web site... There is also a .htaccess 
in the root of the prestashop website. Is there a conflict? This should 
be simple... changing a domain for another one. Any help?

2) a drupal website that needs to redirect all sub-domains and extention 
to one domain. In this second case, it's the opposite problem! With the 
same rewrite rule syntax, we end up with //  (2 slash)

So  "dev.mydomain.com <http://dev.mydomain.com>" or "www.mydomain.ca 
<http://www.mydomain.ca>"  should redirect to "www.mydomain.com 
<http://www.mydomain.com>" but we have : "www.mydomain.com// 
<http://www.mydomain.com//>"

Of course, Drupal also was a .htaccess file at root level. My vhost.conf 
file is were I put my global site config including the rewriterules.

Hope somebody can resolve these 2 problems! Thanks.
Mark

-- 
MAP