CodeIgniter Forums
htaccess: combine no index with no www - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: htaccess: combine no index with no www (/showthread.php?tid=47969)



htaccess: combine no index with no www - El Forum - 12-30-2011

[eluser]Unknown[/eluser]
I've been searching for how to combine in the htaccess the no index.php option along with a rewrite rule to omit the www. in the domain name.

I've only come so far to combine this, but doesn't work. Any hints on this?


Code:
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^.*$ http://domain.com%{REQUEST_URI} [R=301,L]

Thanks! :-)