Welcome! Log In Create A New Profile

Advanced

help with rewrite

Posted by asmith 
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: 71
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready