I am trying to configure my index.php from the document root to open the other files. I don't need to do that on the .htaccess My file structure is the following:
/application
/database
/dbmanager.php
/php
index.php
login.php
/models
/resources
/css
/master.css
/js
/general.js
/img
/logo.png
index.php
What I want is to configure so I can pick the files request from the index.php root to the application/php/ folders. In my index.php from the document root I have this:
<?php
if (($_SERVER['REQUEST_URI']) == '/login') {
require('application/php/login.php');
exit();
} else {
require('application/php/index.php');
exit();
}
?>
Also, I don't want to appear the application/php/login.php on the link but only /login My HTML link is :
<a href="<?php echo $domain; ?>login" >Login</a>
$domain is the full path domain of my localhost so I don't always write everything. In this case is: "http://localhost:81/{project_name}" and the /login will pick up the file on the folders.
UPDATE:
RewriteBase /application/php/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9_-]+)$ ./application/php/index.php
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ ./application/php/index.php
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ ./application/php/index.php