Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Joomla: Redirecting non-www to www with .htaccess

Joomla: Redirecting non-www to www with .htaccess 2 years 8 months ago #354

  • itkit
  • itkit's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 91
  • Thank you received: 0
If you want to redirect all non-www requests to your site to the www version, all you need to do is add the following code to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Please Log in to join the conversation.

Redirecting www to non-www 2 years 8 months ago #355

  • itkit
  • itkit's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 91
  • Thank you received: 0
Redirecting www to non-www
If you want to do the opposite, the code is very similar:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^my-domain\.com$ [NC]
RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L]

Please Log in to join the conversation.

  • Page:
  • 1
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Time to create page: 0.256 seconds

About Us

ITKIT Design Company is an experienced and passionate group of designers, developers, project managers, writers and artists, Web Hosting, Network. Every client we work with becomes a part of the team !

Payment Method

We are using secure Paypal & Money-bookers payment method. You can pay directly form your Credit Card via Moneybookers or Paypal and NEVER store your card information on our site

  • paypal icon
  • visa icon
  • skrill icon

Contact Us

Address : veddestavägen 24, 17562 Järfälla,  Stockholm, Sweden
Phone : +46 8 297100

Newsletters

Subscribe to all RSS or just section you care