Forum Moderators: coopster & phranque

Message Too Old, No Replies

htaccess - multiple files request

help pleas

         

wharsono

5:32 pm on May 26, 2002 (gmt 0)

10+ Year Member



<Files local>
ForceType application/x-httpd-php
</Files>

This htaccess script forces every request that starts with "/local/" to call a script called "local"

But how to make this request muliple files such as

local
district
country

thank you

DrDoc

10:46 pm on May 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You mean, if they type in "/district" it will open the script "district"?

wharsono

6:02 am on May 28, 2002 (gmt 0)

10+ Year Member



DrDoc > Yes What I Means
While someone request district they wil get district script.

And how much the htaccess can handle the files

volatilegx

5:53 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I thought that

<Files local>
ForceType application/x-httpd-php
</Files>

forces any file with "local" in the name to be treated/parsed as a php file.

The easiest way to accomplish this using different file names is by adding separate <files> statements. You could create a regex, but in my opinion, for only three filenames, it'd be easier to do it with three different statements.

wharsono

10:14 am on May 31, 2002 (gmt 0)

10+ Year Member



volatilegx > did u means like this

<Files local>
ForceType application/x-httpd-php
</Files>

<Files district>
ForceType application/x-httpd-php
</Files>

<Files country>
ForceType application/x-httpd-php
</Files>

Thank You

volatilegx

4:36 pm on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



exactly :)

volatilegx

4:40 pm on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You know what, though, I guess there is an easy way to do it with a regular expression (regex):

<FilesMatch "local¦district¦country">
ForceType application/x-httpd-php
</FilesMatch>

See [httpd.apache.org...] for documentation on the Files and FilesMatch directives for the Apache webserver.