Posted By

Toddish on 10/30/09


Tagged

urls seo


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jannisg


.htaccess - www -> http:// - http:// -> www - nice URLs


 / Published in: Apache
 

  1. Options -Indexes
  2. Options +FollowSymLinks
  3. RewriteBase /
  4. RewriteEngine On
  5.  
  6.  
  7. ## /id/product-name/ to index.php?id=id
  8. RewriteRule ^([0-9]*)/(.*)$ index.php?id=$1 [L]
  9.  
  10. ## non www to wwww ##
  11. RewriteCond %{HTTP_HOST} .
  12. RewriteCond %{HTTP_HOST} !^www\.site\.com [NC]
  13. RewriteRule (.*) http://www.site.com/$1 [R=301,L]
  14.  
  15.  
  16. ## www to non www ##
  17. RewriteCond %{HTTP_HOST} !^site\.com$
  18. RewriteRule (.*) http://site.com/$1 [R=301,L]

Report this snippet  

You need to login to post a comment.