Hi,
I am trying to setup www to non-www redirect. The problem I'm having is that once redirected, "?rewrite=1" is added to the end of URL.
I would like redirect to work without changing URL as I notice search engines are indexing some pages with "?rewrite=1".
I'm using this in .htaccess:
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
I have also tried this in virtual hosts file and have same results:
<If "%{HTTP_HOST} != 'website.com'">
Redirect 301 / https://website.com
</If>
I know this is something related to SE PHP as I have tried this on my other websites and not experiencing same issue.
Anyone know how to to get this to work properly?
Hm, this can probably be deleted.
Browser cache and because I was doing permanent redirect messed me up.
Do you mind if I keep it? It could help other clients.