My Local Services UK
My Local Services USA
Business Discussion
Marketing Advice & Assistance
and some business banter...


Go Back   My Local Business Forum > The Business Forums > Computers, Coding, Websites or anything techie

Computers, Coding, Websites or anything techie Help, assistance, advice and discussions on anything to do with computers, hosting, web coding or anything technical!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 27-09-10, 03:52 PM
sjr4x4's Avatar
Professional Waffler
 
Join Date: Sep 2009
Location: Bills Town, Wark's, UK
Age: 43
Posts: 5,131
Thanks: 1,076
Thanked 486 Times in 405 Posts
Facebook Profile LinkedIN Profile Twitter Profile
Unhappy .htacess file - anyone help?

Bit stumped with this one, and managed to break the forum earlier.

We used to run on a different URL, which is now defunct, but I want to put a 301 redirect from mylocalforums.com to www.mylocalforums.com

Thought I had the syntax right, but as soon as I change it, the Forum (other than the index page) goes off the air

Using VBSEO, but from what I can see, it still references the .htaccess

Current .htaccess is:

RewriteEngine On
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]

RewriteCond %{HTTP_HOST} ^usabusinessforums.us$ [OR]
RewriteCond %{HTTP_HOST} ^www.usabusinessforums.us$
RewriteRule ^(.*)$ "http\:\/\/www\.mylocalforums\.com$1" [R=301,L]


So surely I just need to replace the last 3 lines with:
RewriteCond %{HTTP_HOST} ^mylocalforums.com$ [nc]
RewriteRule ^(.*)$ "http\:\/\/www\.mylocalforums\.com$1" [R=301,nc,L]


Added nc just for any case sensitive issues.

But If I save this, it doesn't work

Any apache gurus?
__________________
cheers Steve
Forum Admin - teaboy and general gofer...

Forum Rules and FAQ's at a glance | Find me on Google+ | or even Facebook!

My Local Services - The UK and US Online Business Directory | JobsVitae - Recruitment Help and CV Creation

If you're here to spam, then expect a ban

Reply With Quote

  #2 (permalink)  
Old 29-09-10, 06:47 PM
Bowen73's Avatar
Growing Business
 
Join Date: Sep 2010
Location: Stoke on Trent - Staffs - UK
Age: 39
Posts: 30
Thanks: 2
Thanked 4 Times in 4 Posts
Default

cant this be done via the hosts using the dns settings to divert all traffic to the www domain insted of using a 301 via the htaccess?

i.e. i can use either poshkitty.co.uk or Posh Kitty - Personalised Gifts for all the family for all occassions to get to my site

Reply With Quote
  #3 (permalink)  
Old 29-09-10, 06:50 PM
Bowen73's Avatar
Growing Business
 
Join Date: Sep 2010
Location: Stoke on Trent - Staffs - UK
Age: 39
Posts: 30
Thanks: 2
Thanked 4 Times in 4 Posts
Default

well the last comment didnt show right becuase it filled in the page name instead of the address...lol...

but anyways... try this:

Redirecting entire sites with 301

The 301 directive is quite powerful. You can redirect not just single files but entire sites, for example when changing domain names e.g.

HTML Code:
redirect 301 / http://www.you.com/
The first "/" indicates that everything from the top level of the site down should be redirected. As long as you are using the same paths and filenames, then this option is a very simple way to perform site redirection in the situation where you have only changed your domain name.

Reply With Quote
  #4 (permalink)  
Old 29-09-10, 07:01 PM
Bowen73's Avatar
Growing Business
 
Join Date: Sep 2010
Location: Stoke on Trent - Staffs - UK
Age: 39
Posts: 30
Thanks: 2
Thanked 4 Times in 4 Posts
Default

i have found something else that might help too for redirecting non-www to www:

HTML Code:
Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^yoursite.com [NC] 
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
not sure if any of this will help though, but its worth a try

Reply With Quote
  #5 (permalink)  
Old 30-09-10, 08:55 AM
sjr4x4's Avatar
Professional Waffler
 
Join Date: Sep 2009
Location: Bills Town, Wark's, UK
Age: 43
Posts: 5,131
Thanks: 1,076
Thanked 486 Times in 405 Posts
Facebook Profile LinkedIN Profile Twitter Profile
Default

Quote:
Originally Posted by Bowen73 View Post
Redirecting entire sites with 301

The 301 directive is quite powerful. You can redirect not just single files but entire sites, for example when changing domain names e.g.

HTML Code:
redirect 301 / http://www.you.com/
Cheers mate, didn't think of that way, always thought the best way was from the .htaccess

Quote:
Originally Posted by Bowen73 View Post
i have found something else that might help too for redirecting non-www to www:

HTML Code:
Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^yoursite.com [NC] 
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
not sure if any of this will help though, but its worth a try
Yup I might have to revisit the actual syntax of the redirect. Mine was last set up by the previous hosting company, when we moved URL's, but not sure why its http\:\/\/www\

More research needed me thinks!
__________________
cheers Steve
Forum Admin - teaboy and general gofer...

Forum Rules and FAQ's at a glance | Find me on Google+ | or even Facebook!

My Local Services - The UK and US Online Business Directory | JobsVitae - Recruitment Help and CV Creation

If you're here to spam, then expect a ban

Reply With Quote
Reply

Bookmarks

Tags
.htaccess, apache



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


PublicLiabilityInsurance.org - Public Liability Insurance    List your business for free with Qype  Try KashFlow accounts for free


All times are GMT +1. The time now is 07:44 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0
This Business Forum is owned and run by Lowi Ltd | Minerva Mill | Station Road | Alcester | Warwickshire | B49 5ET | UK | Reg: 5542028 | VAT: 871389294