Results 1 to 3 of 3

 

Thread: canonical url help with directories

  1. #1
    Ian Ebbs

    Status
    Offline
    Join Date
    Aug 2003
    Location
    England
    Posts
    1,096
    Thanks
    5
    Thanked 6 Times in 2 Posts


    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

  2. #2
    csn
    csn's Avatar
    Small Affiliate :-)

    Status
    Offline
    Join Date
    Dec 2006
    Location
    Cardiff, UK
    Posts
    1,037
    Thanks
    67
    Thanked 43 Times in 36 Posts
    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.

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Jun 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. URL encoding & affiliate deep links
    By pollensa in forum Programming
    Replies: 9
    Last Post: 13-06-06, 12:52 PM
  2. dumb question but... url redirect
    By Shane in forum Affiliate Marketing Lounge
    Replies: 12
    Last Post: 13-09-03, 06:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2