help with rewrite
December 08, 2009 08:10AM
Hi,

I have 2 .htaccess files:

1. example.com/.htaccess
2. example.com/forums/.htaccess

1. .htaccess: (rewrite part)

[code]
RewriteCond %{HTTP_HOST} ^www\.example\.com
RewriteCond %{REQUEST_URI} !^/forums/([^.]+)?$
RewriteRule ^(.+)/(.+)/$ index.php?file=$1&action=$2 [L,QSA]

RewriteCond %{HTTP_HOST} ^www\.example\.com
RewriteCond %{REQUEST_URI} !^/forums/([^.]+)?$
RewriteRule ^(.+)/$ index.php?file=$1 [L,QSA]
[/code]

2. .htaccess
Just so many rewrite rules without any conditions. I guess I can simply copy them for my nginx hosts file.


How can I write the first file?
also I wanna restrict access to file with .phpD so that if a user trying to access it, it shows him forbidden error.

Thanks for your time
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready