need quick htaccess help!

Spawn

BANNED
Joined
Jun 20, 2009
Messages
1,186
Reaction score
394
Website
www.webbiy.com
should take 5 minutes, just need a small tweak to change from a www. to regular http:// let me know! ill pay 5usd
 

nufaman

Elite Member
Joined
May 29, 2009
Messages
1,870
Reaction score
1,341
You mean www to non www?

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

In both cases, make sure to replace "domain" with the URL of your domain.
 

nufaman

Elite Member
Joined
May 29, 2009
Messages
1,870
Reaction score
1,341
Do you know how to Ftp? You'll need to edit your .htaccess file and put that at the top of it
 

Spawn

BANNED
Joined
Jun 20, 2009
Messages
1,186
Reaction score
394
Website
www.webbiy.com
i have a site at http://example.co i setup the blog mistakenly at http://www.example.co/blog/
im trying to make it http://example.co/blog/
thank you!
 

rannybo

Junior Member
Joined
Jul 7, 2007
Messages
174
Reaction score
78
Like Nufaman stated above go get a FTP client like Filezilla.

Go to public_html folder of your domain that your trying to change the www to non www

Look for .htaccess file

Open .htaccess to edit file

Place the following code at the beginning of the .htaccess file:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^http://www.example.co [NC]
RewriteRule ^(.*)$ http://example.co/$1 [L,R=301]

Replace example.co with your domain name.

Test your server to see if it works. You might have to restart apache.
 
Last edited:
Top