WWW addresses with trailing path needs no WWW
-
tenntim
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
9 years 11 months ago #3814
by tenntim
I have the following rule in my .htaccess file:
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]
...and it works, but only works when you literally enter
www.example.com (this properly redirects to example.com)...doesn't work for any other links that have a trailing path like this
www.example.com/products/ (doesn't redirect to the non www version of the same).
Can I create a rule in ReDJ to handles all of the links on my site...and redirect anything with "www." to "http://"...and if so, what would that look like?
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
9 years 11 months ago #3816
by admin
Maybe you can fix your rule from:
RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]
To:
RewriteRule ^(.*)$ "http\:\/\/example\.com\/$1" [R=301,L]
Kind regards,
Luigi
Please Log in or Create an account to join the conversation.
Time to create page: 0.139 seconds