Link to home
Create AccountLog in
Avatar of expertsgerrit
expertsgerrit

asked on

redirect www.xyz.com to xyz.com and the other way around

Hi,

is there a way to redirect any url of the form www.xyz.com/any_folder/anyfile.php?parameter=any_parameter

to
xyz.com/any_folder/anyfile.php?parameter=any_parameter

?
And is the xyz.com/..... option compatible with all browsers?

Regards,
G
Avatar of l4ncel0t
l4ncel0t

no problem

        RewriteEngine On
        RewriteCond %{HTTP_HOST} www\.xyz\.com
        RewriteRule ^/(.*)$ https://xyz.com/$1 [L,R=301]


This should work
Avatar of expertsgerrit

ASKER

where should I put this?
any file that gets visited
some header file?
ASKER CERTIFIED SOLUTION
Avatar of l4ncel0t
l4ncel0t

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account