Forum Moderators: phranque

Message Too Old, No Replies

Really confused with .htaccess and .mod_rewrite.htaccess

         

tama

1:21 am on Oct 13, 2005 (gmt 0)

10+ Year Member



My site runs on a CMS and I'm trying to figure out why all but one directory is getting crawled. I've been scanning through old .htaccess threads around here and I'm learning a lot and discovering many new questions as well.

I would appreciate some help on a few questions there if you can spare a minute.

As far as my site goes, I have a .htaccess file and a .mod_rewrite.htaccess files. Can both of these co-exist together?

The .htaccess is:

<Files *.xslt>
SetHandler text/xml
</Files>

<Files categories>
SetHandler application/x-httpd-php
</Files>

<Files articles>
SetHandler application/x-httpd-php
</Files>

<Files pages>
SetHandler application/x-httpd-php
</Files>

<Files blogs>
SetHandler application/x-httpd-php
</Files>

<Files authors>
SetHandler application/x-httpd-php
</Files>

<Files search>
SetHandler application/x-httpd-php
</Files>
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.*$ [L,R]

I've never seen anything like this. What does "SetHandler application" mean?

Also, where would I insert my deny/allow instructions?

Why would one subdirectory within my site not get indexed when every page on the site has a link to it and there's no mention of it in the .htaccess file?

Sorry so many questions....

jdMorgan

2:20 am on Oct 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I have a .htaccess file and a .mod_rewrite.htaccess files. Can both of these co-exist together?

Sure, because .mod_rewrite.htaccess is meaningless to Apache, and will probably be ignored -- Unless you have some script that uses it for some purpose.

The next one is pretty easy to answer: SetHandler [httpd.apache.org].

In your .htaccess file, these SetHandler directives are conditional; They only apply if the requested URL resolves to the filepath specified in the <Files> container containing the SetHandler directive.

As to where you insert mod_access [httpd.apache.org] directives, that's up to you and depends entirely on what you want to do. You should be aware that the order that you place directives into .htaccess is meaningful in only a limited way; Directives handled by a given Apache module will be processed in the order that you specify. However, the server configuration controls the order that the various modules execute in, each one processing commands from your file that it recognizes. So, for example, you cannot control whether a mod_access directive or a mod_rewrite directive will execute first from within .htaccess; the module execution order is configured in httpd.conf.

Jim