Zen Cart Logo
Forums / General Questions / htaccess file meaning of

htaccess file meaning of

Locked

Views: 2,208

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
28 May 2007, 11:45 AM
#1
ramblas avatar

ramblas

New Zenner

Join Date:
Mar 2006
Posts:
15
Plugin Contributions:
0

htaccess file meaning of

Hi
Just wanted to get some Info on the importance of the .htaccess file (and maybe robots.txt) while I am at it.

I recently made a Site (https://www.sasupplies.com) and while the Site was showing up fine in Google and other Search Engines I struggled with getting it to show up in our local South African Search Engine (https://www.ananzi.co.za). As most if not all our Sales would come from the local S.A Market I tried everything to get the Site Listed .Thats confusing- It WAS listed but would not show up for any Searches against it ( I even created some fairly unique Custom Products and searched for them but NO Results came back.) Even more confusing was the fact that if I made a general Search on Ananzi no results were returned But If I chose to search the "SA Directory" , the Site did come back. I checked Metatags etc but could not find a Fault. Then decided to delete the htaccess file and now the Search yields results.
Just wondering if there is something wrong with this File: Copy below and If I should restore if for any Reason. I have got no Idea how this htaccess was created, but if there is something like a Sample htaccess file which I could use please advise.
Regards
Manfred

COPY OF HTACCESS

<IfModule mod_php4.c> php_value session.use_trans_sid 0 </IfModule> RewriteEngine On #RewriteBase /sNews15 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*) $1 [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?category=$1 [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1 articlespage=$2 [L]
29 May 2007, 4:21 PM
#2
humbll avatar

humbll

Zen Follower

Join Date:
Jan 2007
Location:
USA
Posts:
219
Plugin Contributions:
0

Re: htaccess file meaning of

You do not need ANY of that at all. the only line you "need" is a 404 error handler if you wish to use the 404 error page included with zencart and editable in the define pages editor in the admin. In that case delete all that stuff in there, the file should simply read:

**ErrorDocument 404 /index.php?main_page=error404 **

otherwise jut delete the entire file from your server.

29 May 2007, 6:54 PM
#3
humbll avatar

humbll

Zen Follower

Join Date:
Jan 2007
Location:
USA
Posts:
219
Plugin Contributions:
0

Re: htaccess file meaning of

ramblas:

Hi
Just wanted to get some Info on (and maybe robots.txt) while I am at it.

as for robots.txt, if you want all spiders (robots) to have complete access to your site, then it should contain the lines:

**User-agent: *
Disallow:

** If there are pages you want to stop all spiders from seeing/indexing, you would put:

**User-agent: *
Disallow: /index.php?main_page=login
Disallow: /index.php?main_page=shopping_cart

**you put a Disallow: for each page you want to stop them from indexing.

If there is an unfriendly robot you want to block from accessing your site at all, then you can put lines like:

**User-agent: brown_recluse__spider_bot
Disallow: *

****User-agent: blackwidowspiderbot
Disallow: *

**you put each spider you want to block on its own line. the * of course is a universal wildcard telling it not to go to any page on your site. If you want to block a specific robot from just 1 page instead of a (*) wildcard use its name:

**User-agent: brown_recluse__spider_bot
Disallow: **/index.php?main_page=login
**Disallow: ****/index.php?main_page=shopping_cart

**You can also tell the spider where your sitemap is, usually it has to be in root directory of site to be accepted:

Sitemap: http://www.mysite.com/sitemap.txt

Those are the basics of robots.txt and if you look about i'm sure there is better info than this on it..

I hope I didn't confuse you. Good Luck!

29 May 2007, 7:11 PM
#4
econcepts avatar

econcepts

Totally Zenned

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

Re: htaccess file meaning of

Before you delete anything in that file, I would make a backup. The contents of that file (in your case) specifically turns on the "mod re-write engine" which is used to transform URLs from this (as an example): http://www.yoursite.com/product.php?id=1&cat=2 (etc..)

to something more search engine friendly like:

http://wwwyoursite.com/cell-phone-xyz.html

If you you are using that type of feature with your current cart, removing those lines from the .htaccess file will eliminate that functionality.

30 May 2007, 6:18 AM
#5
humbll avatar

humbll

Zen Follower

Join Date:
Jan 2007
Location:
USA
Posts:
219
Plugin Contributions:
0

Re: htaccess file meaning of

econcepts:

Before you delete anything in that file, I would make a backup. The contents of that file (in your case) specifically turns on the "mod re-write engine" which is used to transform URLs from this (as an example): http://www.yoursite.com/product.php?id=1&cat=2 (etc..)

to something more search engine friendly like:

http://wwwyoursite.com/cell-phone-xyz.html

If you you are using that type of feature with your current cart, removing those lines from the .htaccess file will eliminate that functionality.

He already has a backup copy, in his original post ;)