Results 1 to 4 of 4
Thread: .htaccess redirection
-
08-25-2009, 08:55 PM #1Web Hosting Guru
- Join Date
- Dec 2006
- Posts
- 292
.htaccess redirection
Trying to remove the 'www' from all incoming requests (http or https)
For example:
If you type in http://www.domain.com it redirects you to https://domain.com
If you type in https://www.domain.com it redirects you to https://domain.com
Currently this is in the .htaccess:
Code:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule>
Mod_rewrite is installed and running properly.
Any suggestions would be greatly appreciated.
Thanks!
-
08-26-2009, 03:58 AM #2Disabled
- Join Date
- Apr 2009
- Posts
- 256
Try the following code :
Code:RewriteEngine on RewriteCond %{HTTP_HOST} ^www.domain.com RewriteRule ^(.*) http://domain.com/$1 [R]
-
08-26-2009, 04:09 AM #3Junior Guru
- Join Date
- Jul 2009
- Posts
- 212
-
08-26-2009, 04:35 AM #4Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
If you need everything redirected to https://domian.com, use the following rule.
Code:RewriteEngine On RewriteCond %{HTTPS} !^on$ [NC] RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
Similar Threads
-
.htaccess - domain redirection
By webpromo in forum Programming DiscussionReplies: 1Last Post: 03-02-2007, 01:09 PM -
.htaccess redirection
By RGoulding in forum Programming DiscussionReplies: 7Last Post: 06-22-2005, 08:15 AM -
htaccess and redirection
By 3-rx in forum Web Design and ContentReplies: 9Last Post: 05-21-2005, 10:00 PM -
.htaccess redirection - How to?
By webzila in forum Web Design and ContentReplies: 2Last Post: 01-04-2004, 04:06 PM -
Need .htaccess redirection
By Spunky in forum Hosting Security and TechnologyReplies: 6Last Post: 05-21-2002, 05:38 AM