× Here you can get community support related to ReDJ.

WWW addresses with trailing path needs no WWW

  • tenntim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 2 weeks 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.

More
9 years 1 week 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.092 seconds