Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 02-02-07
Kandevil's Avatar
Ian Ebbs
 
Join Date: Aug 2003
Location: England
Posts: 1,070
Thanks: 0
Thanked 0 Times in 0 Posts
Kandevil is an unknown quantity at this point
  Question canonical url help with directories

Guys need a little assistance if you please:

I would like to redirect subdirectories on my site to make sure I don't have canonical url problems with them, but am having difficulty. Works fine on root but not on the directories. I am using:

Code:
# IF there's a host field at all
RewriteCond %{HTTP_HOST} .
# IF domain does not start with www
RewriteCond %{HTTP_HOST} !^www\.domainname
# THEN redirect everything to an appropriate location
RewriteRule (.*) http://www.domainname.co.uk/$1 [R=301,L]
I assumed that it would work, but now I have checked and it doesn't.
__________________

affiliates4u Fantasy Football Winner 2007/08
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 18-02-07
csn's Avatar
csn csn is online now
Hard Working Affiliate
 
Join Date: Dec 2006
Location: Cardiff, UK
Posts: 709
Thanks: 9
Thanked 11 Times in 9 Posts
csn is an unknown quantity at this point
  Re: canonical url help with directories

I'm no htaccess expert but would this work?

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^abc/$ http://abc.com
Then visit http://www.yourdomain.com/abc/ and it would redirect. Could be wrong though

Personally, I prefer to use a php script or a database script.

You could have a redirect.php file and then if $link was equal to abc, redirect off to http://abc.com.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 18-02-07
Registered User
 
Join Date: Jun 2005
Posts: 972
Thanks: 0
Thanked 0 Times in 0 Posts
Itchy is an unknown quantity at this point
  Re: canonical url help with directories

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


that should do it i hope
__________________
I'm not the Messiah!
I say You are, Lord, and I should know. I've followed a few.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Link Partners deano6410 Search Engine Strategies 4 18-08-06 11:43 AM
URL encoding & affiliate deep links pollensa Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 9 13-06-06 12:52 PM
This new google adwords destination url rule, what if.... Brad123 Organic Google Search Optimisation 8 10-02-05 08:03 PM
why are my articles showing up in directories first?!! Matt Seigneur Organic Google Search Optimisation 1 28-01-05 11:48 AM
dumb question but... url redirect Shane The Affiliate Marketing Lounge 12 13-09-03 06:56 AM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7