Restrict access to files

Fix it!!

Restrict access to files

Postby johan_lunds » Mon Apr 03, 2006 10:19 am

Code: Select all
Options +FollowSymLinks

RewriteEngine on

RewriteRule ^includes[^\.]/?(.*)$ - [F]
RewriteRule ^template\.php$ - [F]

RewriteRule ^shop/artikelnr/([0-9]+)/?$ shop_show_prod.php?art=$1 [NC,L]
RewriteRule ^shop/produkt/([0-9]+)/?$ shop_show_prod.php?prod=$1 [NC,L]
RewriteRule ^shop/kategori/([0-9]+)/?$ shop_show_cat.php?cat=$1 [NC,L]
RewriteRule ^vet/aktuell-information/([0-9]+)/?$ vet_aktuell-information.php?id=$1 [NC,L]

RewriteRule ^om-webbplatsen/?$ ovrigt_om-webbplatsen.php [NC,L]

RewriteRule ^(shop|webbvet|vet)/?$ $1_index.php [NC,L]

RewriteRule ^(.*)/$ $1
RewriteRule ^(shop|webbvet|vet)/([A-Za-z0-9-_]+)$ $1_$2\.php [NC,L]


I want to restrict access to the original files, named shop_*.php, vet_*.php and webbvet_*.php, ovrigt_*.php.
But i still want to allow access in css/ etc.

How do I do that?

Appreciating all the help I can get. Thx!
/Johan
johan_lunds
 
Posts: 2
Joined: Mon Apr 03, 2006 9:21 am

not rewrite but might work

Postby softtoy » Thu Jul 06, 2006 1:59 am

Code: Select all
<Files shop_*.php>
order deny,allow
deny from all
</Files>

This works?
softtoy
 
Posts: 26
Joined: Mon Jun 12, 2006 9:45 pm

Re: not rewrite but might work

Postby johan_lunds » Thu Jul 06, 2006 3:50 am

softtoy wrote:
Code: Select all
<Files shop_*.php>
order deny,allow
deny from all
</Files>

This works?


I guess. It looks good, but I haven't tried, because I have changed my application now. But thanks a million anyway, I bet it comes a time when I can use that code snippet, or a modified one, too.

/Johan
johan_lunds
 
Posts: 2
Joined: Mon Apr 03, 2006 9:21 am


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 1 guest

cron