Forum Moderators: phranque
I use these lines in my Apache configuration file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteCond %{REQUEST_FILENAME}!/index.php
RewriteRule ^/(.*)$ [%{HTTP_HOST}...] [L]
Thans these lines, when I ask for:
http://www.example.com/index.php
I obtain from the server:
http://www.example.com/index.php
While when I ask for (for example):
http://www.example.com/docs/general.htm
I obtain from the server:
http://www.example.com/index.php?q=docs/general.htm
So in index.php, I can know the real requested URL.
What I want is that in the URL bar, after request, I can see
"http://www.example.com/docs/general.htm"
and not:
http://www.example.com/index.php?q=docs/general.htm
Where's the error? What I have to add to my lines?
But instead of:
RewriteRule ^/(.*)$ /index.php?q=$1 [L]
I have to write the absolute path:
RewriteRule ^/(.*)$ /var/www/example.com/www.example.com/index.php?q=$1 [L]
Infact I'm managing several domains and several third level domains for each domain. And so I'm using that file system structure.
How can I specify just index.php instead of the full path?
Thanks in advance.
Get that corrected first and then, only if necessary, use the RewriteBase directive of mod_rewrite to further refine the path.
Jim