Rewrite the Base URL with mod_rewrite
- by rotespferd
My Domain example.com points to the directory public_html. In the directory public_html/php is my index.php file.
Now I want that the URL example.com points to *public_html/php/index.php*. I must do this with mod_rewrite because I have no access to the httpd.conf to do something wth Alias oder DocumentBase.
In the directory public_html is my .htacces filewith the following content:
RewriteEngine on
RewriteCond %{HTTP_HOST} exaple.com$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /php/index.php [L,QSA]
This do half of the job, because when I enter something like example.com/s in my browser it points to *public_html/php/index.php* as I want it to do. But when I just enter example.com it points to *public_html*.
What can I do to fix this?