Hello! Me, again...

Just did the includes in my html...which is now shtml. (I'm learning...)

I realized that I needed to REDIRECT the html queries to the appropriate shtml files.

Here is my .htaccess file:

# This file is placed in the ShoBag root directory

<Files *>
Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"
Header set Expires: 0
Header set Pragma: no-cache
</Files>

DirectoryIndex default.shtml

Redirect /default.html /default.shtml
Redirect /about.html /about.shtml
Redirect /contact.html /contact.shtml
Redirect /privacy.html /privacy.shtml
Redirect /return.html /return.shtml
Redirect /site.html /site.shtml
Redirect /uniqconcepts.html /uniqconcepts.shtml
Redirect /index.html /default.shtml
Redirect /index.shtml /default.shtml

ErrorDocument 401 /Error401.shtml
ErrorDocument 403 /Error403.shtml
ErrorDocument 404 /Error404.shtml
ErrorDocument 500 /Error500.shtml

The header commands were put there by my hosting company. I'm guilty on all others.

My problem:

I have another domain (seblake.com) under the shobag directory. It appears that the REDIRECT in the shobag .htaccess "overflows" into all of the subdirectories. Here is the .htaccess I created for the seblake subdirectory:

# This file is placed in the seblake (Max-Tech) directory

<Files *>
Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"
Header set Expires: 0
Header set Pragma: no-cache
</Files>

DirectoryIndex default.html

Redirect /default.shtml /default.html
Redirect /about.shtml /about.html
Redirect /contact.shtml /contact.html
Redirect /privacy.shtml /privacy.html
Redirect /site.shtml /site.html
Redirect /index.html /default.html
Redirect /index.shtml /default.html

ErrorDocument 401 /Error401.html
ErrorDocument 403 /Error403.html
ErrorDocument 404 /Error404.html
ErrorDocument 500 /Error500.html

I'm sure you can recognize the loop...it confuses my browser... ;)

Care to offer a solution?

Also, do I need the header lines in the seblake .htaccess file also?

As always, I thank you for your time and assistance!!

< Steve >

OK. I think I've got it!!!

I'm sure there's a way to clean it up and write it better. I'm all ears!!

# This file is placed in the ShoBag root directory

<Files *>
Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"
Header set Expires: 0
Header set Pragma: no-cache
</Files>

<Files .htaccess>
order allow,deny
deny from all
</Files>

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^Botnames....
RewriteRule ^.* - [F,L] 

DirectoryIndex default.shtml

#  Same syntax per page
Redirect http://www.shobag.com/default.html http://www.shobag.com/default.shtml
Redirect http://www.shobag.com/index.html http://www.shobag.com/default.shtml
Redirect http://www.shobag.com/index.shtml http://www.shobag.com/default.shtml

ErrorDocument 401 http://www.shobag.com/Error401.shtml
ErrorDocument 403 http://www.shobag.com/Error403.shtml
ErrorDocument 404 http://www.shobag.com/Error404.shtml
ErrorDocument 500 http://www.shobag.com/Error500.shtml

And then, I had to make one for the sub-directory (another domain).

# This file is placed in the seblake (Max-Tech) "root" directory

<Files *>
Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"
Header set Expires: 0
Header set Pragma: no-cache
</Files>

<Files .htaccess>
order allow,deny
deny from all
</Files>

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^Botnames....
RewriteRule ^.* - [F,L]

DirectoryIndex default.html

#  Same syntax per page
Redirect default.html [url]http://www.shobag.com/seblake/default.html[/url]
Redirect index.html [url]http://www.shobag.com/seblake/default.html[/url]
Redirect index.shtml [url]http://www.shobag.com/seblake/default.html[/url]

ErrorDocument 401 [url]http://www.seblake.com/Error401.html[/url]
ErrorDocument 403 [url]http://www.seblake.com/Error403.html[/url]
ErrorDocument 404 [url]http://www.seblake.com/Error404.html[/url]
ErrorDocument 500 [url]http://www.seblake.com/Error500.html[/url]

It appears to work... But...is it correct? ;-)

Thank you!!!

< Steve >

Wanted to give you a heads up on the redirects. If for any reason you're hoping to see any of your pages appear in the Google index, then you might want to consider setting those redirects with 301s.

Example:
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
<URL SNIPPED>

301? Or is this just an ad....?

301 Blake.....if it's a permanent fix then it should always be 301

A permanent fix? Pardon my ignorance.... Does that mean if I am going to keep the 401 page that I created as part of my web site, then I should use 301 instead? Is it the same syntax, etc?
Google Index ignores 401s?
Thanks!

your primary efforts should be to minimize your crawl errors as much as possible, and one of the best ways to avoid it is through the usage of 301 redirects to a page that carries content worthy of placing in the index......ideally you want the googlebot to spider down through your content without running into a 4XX error which is like running into a brick wall......i would highly recommend that you set yourself up with google webmaster tools and measure your efforts through the crawl errors you see in there......btw, keep your 401 as your failsafe, but ultimately do what's needed through your 301 redirects to prevent your visitors from ending up there

I'll check it out. Appreciate the help. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.