httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yehuda Katz <yeh...@ymkatz.net>
Subject Re: [users@httpd] rewrite in .htaccess
Date Tue, 24 May 2016 11:51:44 GMT
Because the rewrite rule above it says it uses the last rule to run if it
matches (that is what [L] means). Put your new config above the WordPress
rule.

- Y

Sent from a device with a very small keyboard and hyperactive autocorrect.
On May 24, 2016 6:06 AM, "Miguel González"
<miguel_3_gonzalez@yahoo.es.invalid> wrote:

> Hi all,
>
>   I´m having issues with a migration to a new domain redirecting all
> URLs to the new domain.
>
>   My .htaccess looks like this:
>
>
> <IfModule mod_rewrite.c>
> RewriteEngine On
> RewriteBase /
> RewriteRule ^index\.php$ - [L]
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . /index.php [L]
> </IfModule>
>
> # END WordPress
>
> RewriteCond %{HTTP_HOST} ^oldomain\.com$ [OR]
> RewriteCond %{HTTP_HOST} ^www.olddomain.com$
> RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=302,L]
>
>
> For the time being I´m using a 302 redirect until I made sure it works.
>
> My main problem is that if I tyope old.domain.com I get redirected to
> www.newdomain.com. But if type some sections, I don´t get any redirection:
>
> olddomain.com/team/
> olddomain.com/contact/
> etc
>
> I have purged the Varnish cache in case there is any issue because the
> only section that gets redirected is oldomain.com/wp-admin/ (which is
> bypassed by Varnish).
>
>
> I have Apache 2.4.18 from Cpanel and behind Varnish
>
> Thanks,
>
> Miguel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Mime
View raw message