Hi All,
After running a CMS for a few years, I am rebuilding the way it operates.
For an old set of sites, I am going to do a very basic revamping. I have all paths and filenames stored in the database, so I can fairly easy do a redirect, with the old filestruture remaining intact, yet removing all files except a few from the server:
Internally do:
domain.com/section1/../page.php
to:
domain.com/index.php?section1/../page.php
In the index.php I will resolve which old page was called, and act accordingly. For new sites I will take the thing a step further, but for now I have little choice.
There are a few directories which cannot be rewritten, as content is static. So I want to ignore those.
For my test folder I wrote this set of rules:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/test/((ttt\.php|manage|link|admin|contact)(/.*)?)$ [NC]
RewriteRule ^(.*)$ ttt.php?p=$1 [L]
Which basically refers all pages which are NOT ttt.php, or in folders manage, link, admin or contact, to ttt.php, with the path in the querystring.
My main problem: Why do I need to define the /test/ folder in the condition? I have the .htacces in the folder test, which sits in the root of my webserver. I thought it would take all paths locally; This does not work:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^((ttt\.php|manage|link|admin|contact)(/.*)?)$ [NC]
RewriteRule ^(.*)$ ttt.php?p=$1 [L]
Anybody any suggestions what I am missing? What pitfalls might this code cause?
Thx,
Jelle.