i have some question about the syntax of module rewrite. i would like to know how to write a rule to not include/contain some file?
For example:
Directories structure:
- /
- /home.php
- /profile.php
- /pages
- /pages/index.php
- /pages/.htaccess
About the /pages/index.php content:
<?php include_once "../home.php" ?>
About the /home.php content:
<a href="profile.php">Profile</a>
So: i would like to write a .htaccess in the pages directory, and make the hyperlink (profile.php) is correct when user click on Profile text.
RewriteEngine On
RewriteBase /pages2
RewriteRule ^(images|css|js|plugins)/(.*) http://localhost/$1/$2
# if end with .php ext and file name not index.php then redirect to parent directory
RewriteCond %{SCRIPT_FILENAME} .php$
RewriteCond %{SCRIPT_FILENAME} !index.php$ ## not work ?
RewriteRule ^(.*) http://localhost/$1
In this case , i can not change the root path file content.