htaccess snippets


/ Published in: Apache
Save to your folder(s)

Some url rewriting snippets


Copy this code and paste it in your HTML
  1. ### REWRITE DEFAULTS ###
  2. RewriteEngine On
  3. RewriteBase /
  4.  
  5. ## FORCE WWW ##
  6. RewriteCond %{HTTP_HOST} ^url\.com$ [NC]
  7. RewriteRule ^(.*)$ http://www.url.com/$1 [L,R=301]
  8.  
  9. ## REMOVE index.php ##
  10. RewriteCond %{REQUEST_FILENAME} !-f
  11. RewriteCond %{REQUEST_FILENAME} !-d
  12. RewriteRule ^(.*)$ index.php/$1 [L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.