negation string
Posted: Sat Mar 10, 2007 9:42 am
Hi, i am trying to make database driven website and using .htaccess to make nice url. Regex for .htaccess has been put on the root of the localhost server.
RewriteEngine on
RewriteRule ^([a-zA-Z0-9-]+)$ /$1/ [R=301]
RewriteRule ^([a-zA-Z0-9-]+)/$ main.php?page=$1
The first one is to direct the url that not ended with trailing slash to url with trailing slash, this is not a problem. However the second one give me a problem, if my website http://www.example.com/ already up with control panel known as cpanel , so if I request the url http://www.example.com/cpanel/ it will direct the page to main.php?page=cpanel which is not what I want. So I am trying to figure out how can I make an negation string for "cpanel" . How can I make the RewriteCond so that it will check if the url that is http://www.example.com/cpanel/ will not rewrite the url to main.php?page=cpanel
how do i make negation string for cpanel ?
I used this
RewriteCond %{REQUEST_URI} ^!(/cpanel/)$ but does not work.
Thanks.
RewriteEngine on
RewriteRule ^([a-zA-Z0-9-]+)$ /$1/ [R=301]
RewriteRule ^([a-zA-Z0-9-]+)/$ main.php?page=$1
The first one is to direct the url that not ended with trailing slash to url with trailing slash, this is not a problem. However the second one give me a problem, if my website http://www.example.com/ already up with control panel known as cpanel , so if I request the url http://www.example.com/cpanel/ it will direct the page to main.php?page=cpanel which is not what I want. So I am trying to figure out how can I make an negation string for "cpanel" . How can I make the RewriteCond so that it will check if the url that is http://www.example.com/cpanel/ will not rewrite the url to main.php?page=cpanel
how do i make negation string for cpanel ?
I used this
RewriteCond %{REQUEST_URI} ^!(/cpanel/)$ but does not work.
Thanks.