PHP Classes

File: codeigniter/.htaccess

Recommend this page to a friend!
  Classes of Kabir Hossain   PHP CodeIgniter Tips Tricks   codeigniter/.htaccess   Download  
File: codeigniter/.htaccess
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP CodeIgniter Tips Tricks
Collection of tips and examples to use CodeIgniter
Author: By
Last change:
Date: 16 days ago
Size: 1,417 bytes
 

Contents

Class file image Download
RewriteEngine on RewriteBase / # Redirect all domain name variations to main site RewriteCond %{HTTP_HOST} ^site.com [NC] RewriteRule ^(.*)$ http://www.site.com/$1 [L,R=301] # Force checkout to be secure RewriteCond %{SERVER_PORT} 80 RewriteCond $1 !^(index\.php|images|javascripts|site|admin|stylesheets|robots\.txt) RewriteRule /checkout(.*)$ https://www.site/checkout$1 [L] # Force admin to be secure RewriteCond %{SERVER_PORT} 80 RewriteCond $1 !^(index\.php|images|javascripts|site|checkout|stylesheets|robots\.txt) RewriteRule /admin(.*)$ https://www.site.com/admin$1 [L] # Flip back to http unless in checkout or admin RewriteCond %{SERVER_PORT} !80 RewriteCond $1 !^(index\.php|images|javascripts|checkout|admin|stylesheets|robots\.txt) RewriteRule ^(.*)$ http://www.site.com/$1 [L] # Get CodeIgniter going RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 #I think, instead of RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] #you should have something like RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] #do have the rewrite rule match. Your link is currently produced by the third rule. #CodeIgniter 2 Clean URLs <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>