Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 19-01-07
Registered User
 
Join Date: Feb 2006
Location: Redcar (North East)
Posts: 529
Thanks: 30
Thanked 2 Times in 2 Posts
Ditzy is an unknown quantity at this point
  Please can you help with .htaccess

Ok ... I haven't been all girlie and pathetic for a while so I must be long over due.

I'm still trying to crack this .htaccess thing and after a few failed attempts using online tutorials I'm trying to make a working .htaccess file fit my site (I have permission to use it BTW).

I'm usually pretty good at reading html but I can't make head nor tail of what ever language this is ... please can someone who knows what they're talking about tell me if it makes sense.

It works and redirects any wrongly typed URLs to an error page but I'm not sure if any of it was tailored to the original site and might mess something up with mine.

I've replaced the original domain name with confused.co.uk and the ??/d???????? relates to the domain document root.

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>

order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName confused.co.uk
AuthUserFile /homepages/??/d????????/htdocs/confused/_vti_pvt/service.pwd
AuthGroupFile /homepages/??/d????????/htdocs/confused/_vti_pvt/service.grp
ErrorDocument 404 /404page.shtml

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^\confused\.co.uk
RewriteRule ^(.*)$ http://www.confused.co.uk/$1 [R=permanent,L]
SetEnvIf User-Agent indy.Library$ keep_out #block indy_Library spambot variants


Thanks in advance ... I'm off to lie down
__________________
Time may be a great healer but it's a lousy beautician
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 20-01-07
Registered User
 
Join Date: Jan 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
thirdlight is an unknown quantity at this point
Hi, Ditzy,

That .htaccess works because of the line:

Code:
ErrorDocument 404 /404page.shtml
The "rewrite" bits never get used because your condition never happens.

Code:
RewriteCond %{HTTP_HOST} ^\confused\.co.uk
says: "If the server name starts with 'confused.co<any character>uk' then use the following rewrite rule"

As the server name is 'www.confused.co.uk', it never happens. "^" = "Starts with", your server name starts with "www". I guess the original rewrite was to change htt p://example.com to htt p://www.example.com

The "\" character in the condition is an escape character, to let you use "special" characters. The "." in rewrite conditions means "any character" so to actually specify "a dot" you use \ before it.

For your condition to work it would need to look like:

RewriteCond %{HTTP_HOST} ^www\.confused\.co\.uk

DON'T DO THIS !!

Your rewrite rule reads: "Take the bit after ww w.confused.co.uk and put it after 'htt p://www.confused.co.uk/'"

So basically, all you are doing is rewriting the same url. Waste of time.

The
Code:
ErrorDocument 404 /404page.shtml
is doing everything you need, so probably best to get rid of the rewrite stuff. I would comment it out - put a # at the start of each line:

#Options +FollowSymLinks
#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^\confused\.co.uk
#RewriteRule ^(.*)$ http://www.confused.co.uk/$1 [R=permanent,L]
#SetEnvIf User-Agent indy.Library$ keep_out #block indy_Library spambot variants

If you really want to check for 404 Missing page errors yourself, rather than continue letting the server do it, let me know & I'll dig up some code.

The last line "SetEnv...." is doing nothing, unless there are more conditions that you haven't posted. It checks the "user agent" & if it ends with ($='Ends with' in rewrite world) "indy.Library" it sets a variable, which is only any use if you use the variable somewhere else.

Hope that helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 22-01-07
Registered User
 
Join Date: Feb 2006
Location: Redcar (North East)
Posts: 529
Thanks: 30
Thanked 2 Times in 2 Posts
Ditzy is an unknown quantity at this point
  Re: Please can you help with .htaccess

Thanks for the detailed reply ... our broadband has been down and we've only just got it back so I haven't had chance to have a proper look but I will sit down and give it my full attention.

There was some extra code ... a list of redirects but I don't have any on my site so I deleted those bits.

Thanks again for taking the time to reply.

Best wishes Sue
__________________
Time may be a great healer but it's a lousy beautician
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 22-01-07
Registered User
 
Join Date: Jan 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
thirdlight is an unknown quantity at this point
Happy to help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
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
.htaccess confusion Ditzy Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 5 08-10-06 03:41 PM
.htaccess File Generation Frostie Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 5 18-07-06 01:46 PM
.htaccess, does it really work at all? ninsboak Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 4 13-05-03 09:54 AM
Help with .htaccess ukhighstreet Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 08-05-03 02:22 AM
.htaccess help Nick Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 19-02-03 05:48 PM


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

Content Relevant URLs by vBSEO 3.2.0 RC7