I was figuring out how to clean the URL for my Silex app being in a subdir of my apache server. This is the actual path: /domains/mydomain.com/public_html/silex
with the following subdirs:
public_html/
css/
images/
js/
.htaccess
index.php
src/
templates/
vendor/
So, if I go to: http://www.mydomain.com/silex/public_html/
I'll find my Silex app that is working properly, but in the URL you can see the public_html/
dir. I'd like to hide it somehow since that all my pages such as about/
, contacts/
, etc. will always contain that subdir in front of them.
How to avoid that?
Here's my .htaccess
:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
Basically, I just would like that my URLs become like this:
http://www.mydomain.com/silex/about
http://www.mydomain.com/silex/contacts
http://www.mydomain.com/silex/admin
(etc...)
Instead of:
http://www.mydomain.com/silex/public_html/about
http://www.mydomain.com/silex/public_html/contacts
http://www.mydomain.com/silex/public_html/admin
(etc...)
Thanks very much to all! :)