Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

Urgent .htaccess help

Status
Not open for further replies.
Joined
Jan 5, 2012
Posts
1,070
Reaction score
32
Ok, at the moment my site is just http://mysite.co.uk, but i want it to be http://www.mysite.co.uk, tried doing this by changing the .htaccess file but it tries to go to www. - doesn't load though!

Here's what I have now:


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress




What should it be to get it working the way I want it?
 
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
 
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

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


So this should do it: EDIT - It doesn't, same problem. Tries to connect to www. but it doesn't.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mysite.co.uk
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
 
Last edited:
Should there be a full stop here?

RewriteCond %{HTTP_HOST} !^www\.mysite.co.uk
 
This is what I have in my sites:
PHP:
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.co\.uk [NC]
RewriteRule ^(.*)$ http://www.yourdomain.co.uk/$1 [L,R=301]
Hope it helps!

Craig
 
Your original .htaccess is correct.

Wordpress will default to the way you have the url set up in the settings.

Goto General Settings and make sure you have "http://www." in Wordpress Address and Site Address.
 
Your original .htaccess is correct.

Wordpress will default to the way you have the url set up in the settings.

Goto General Settings and make sure you have "http://www." in Wordpress Address and Site Address.

I'm an idiot, lol. I read that somewhere but forgot about it, cheers!

Now I've just got to figure out how to change my sitemap, it still has http:// rather than http://www. , even uninstalled the plugin (google's XML sitemap or something) and reinstalled but it's still the same.
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom