Forums / General Questions / htaccess help please?

htaccess help please?

Locked

Views: 1,738

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
7 Oct 2010, 9:02 AM
#1
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

htaccess help please?

Hi there,
I have had these rules in my htaccess for a while on my old server, iv now moved server and for some reason google can no longer find my sitemaps due to a redirect error etc etc...

RewriteEngine On
# redirects any URL that includes: record_company.php/password_forgotten.php
RedirectMatch Permanent ^/(.*[record_company.php]+) /page_not_found.php
# redirects any URL that includes: /images/wp- with 'wp-' being anything that ends with '.php'
# this allows for images named such as 'wp-header.jpg' to work
RedirectMatch Permanent ^/(.*[images]+)/(wp-.*\.php)$ /page_not_found.php
# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/ADMINAREA/.* [NC]
# Don't rewite shop directory
RewriteCond %{REQUEST_URI} !^/shop/.* [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors.* [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) /index.php?%{QUERY_STRING} [L]

no idea when it comes to htaccess

but which of these would stop google finding my sitemaps??

p.s ADMINAREA is my directory renamed for security on here

i may not know how yet, but i soon will....i hope :)

7 Oct 2010, 1:49 PM
#2
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: htaccess help please?

Google looks at your ROBOTS.TXT file to find the location of your XML sitemap. When you moved the site did you move your robots.txt file over as well? If not you need to add that (with the proper link and authorization to your XML sitemaps). If you added it, and it still is not working you need to make sure the path to the XML sitemap is correct.

You might also want to check your Google Webmaster tools section to make sure it is pointing to the correct location as well.

Eric
20 Ways to Increase Sales Using Zen Cart
Zen Cart contribs: Simple Google Analytics, Export Shipping Information

11 Oct 2010, 7:49 AM
#3
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: htaccess help please?

yep moved the robots txt over etc
webmasters is looking in the right place, it finds my sitemap when i rename it to .htaccess.bak
perfect find etc etc...
rename it back to .htaccess
finds nothing... :S

i may not know how yet, but i soon will....i hope :)

11 Oct 2010, 8:14 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: htaccess help please?

Just a simple suggestion: have you tried commenting-out or removing individual lines to narrow down which one is causing your problem?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Oct 2010, 9:14 AM
#5
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: htaccess help please?

i did comment out a few that i thought could cause the problem, but still the same :S

i may not know how yet, but i soon will....i hope :)

11 Oct 2010, 9:29 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: htaccess help please?

"a few" doesn't sound like it's a thorough enough test, as evidenced by your results :blush:

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Oct 2010, 9:43 AM
#7
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: htaccess help please?

DrByte:

"a few" doesn't sound like it's a thorough enough test, as evidenced by your results :blush:

lol yeah i know, but the few that i didn't comment out were to do with record company/password forgot... images-wp.jpg etc....

il have to have another go on it when i get time(god work sucks when i have to go out on site :( lol )

i may not know how yet, but i soon will....i hope :)

11 Oct 2010, 12:56 PM
#8
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: htaccess help please?

Have you checked the permissions on the robots.txt file? It could be that the .htaccess is restricting access to that (may be obvious.)

When I try to access your robots.txt I get a 403 forbidden error message currently (leading me to believe the file is being blocked.)

When you rename the .htaccess, that in effect removes the restrictions and thus enables it to be found.

Just some more thoughts for you.

I don't know if this is the site in question, but I was trying to access it on the tools-draper site. I'm assuming (may be a bad idea) that this is the site in question?

Eric
20 Ways to Increase Sales Using Zen Cart
Zen Cart contribs: Simple Google Analytics, Export Shipping Information

11 Oct 2010, 1:37 PM
#9
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: htaccess help please?

econcepts:

Have you checked the permissions on the robots.txt file? It could be that the .htaccess is restricting access to that (may be obvious.)

When I try to access your robots.txt I get a 403 forbidden error message currently (leading me to believe the file is being blocked.)

When you rename the .htaccess, that in effect removes the restrictions and thus enables it to be found.

Just some more thoughts for you.

I don't know if this is the site in question, but I was trying to access it on the tools-draper site. I'm assuming (may be a bad idea) that this is the site in question?
on one of 3 sites yes m8, tools-draper, and 2 others etc...
ahh didn't think of htaccess restricting robots...hmmmm :D

hmmm in my htaccess file that comes with ZC1.3.9g
added txt to the "<filesmatch>" part, seems i now have access to it :D

i may not know how yet, but i soon will....i hope :)

11 Oct 2010, 3:01 PM
#11
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: htaccess help please?

econcepts:

So did that fix everything?

yup :D
adding the |txt to filematch worked :D
google can now find meeee :D

i may not know how yet, but i soon will....i hope :)

11 Oct 2010, 8:41 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: htaccess help please?

spid3r1987:

hmmm in my htaccess file that comes with ZC1.3.9g
added txt to the "<filesmatch>" part, seems i now have access to it
Um ... The "htaccess that comes with ZC1.3.9g" doesn't restrict robots.txt files ... because there IS NO .htaccess in the root folder of the ZC files, which would be where your robots.txt file is put.

So, it appears that you've copied content from the /includes/.htaccess into a custom /.htaccess file, and thus broke normal operation.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Oct 2010, 10:54 AM
#13
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: htaccess help please?

DrByte:

Um ... The "htaccess that comes with ZC1.3.9g" doesn't restrict robots.txt files ... because there IS NO .htaccess in the root folder of the ZC files, which would be where your robots.txt file is put.

So, it appears that you've copied content from the /includes/.htaccess into a custom /.htaccess file, and thus broke normal operation.

so in ZC root, there should be NO .htaccess file??

i may not know how yet, but i soon will....i hope :)

14 Oct 2010, 2:14 PM
#14
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: htaccess help please?

Zen Cart default does not have an .htaccess file in the 'root' dir. but that doesn't mean you can't have one.

The .htaccess file for example that you provided in your original post is a custom .htaccess file that does go in your Document Root. If you include parts of other .htaccess files though, that are from other .htaccess files located in other directories, it could lead to problems such as you were experiencing.

The learning is in the doing.

Potent Products

14 Oct 2010, 3:36 PM
#15
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: htaccess help please?

Website Rob:

Zen Cart default does not have an .htaccess file in the 'root' dir. but that doesn't mean you can't have one.

The .htaccess file for example that you provided in your original post is a custom .htaccess file that does go in your Document Root. If you include parts of other .htaccess files though, that are from other .htaccess files located in other directories, it could lead to problems such as you were experiencing.
hmmm, i think the htaccess i originally posted was to do with the SEO that i was running, im no longer using this SEO...so dont need the htaccess anymore lol

i may not know how yet, but i soon will....i hope :)