How to detect root folder in URI when using apache mod_alias and mod_rewrite?

Niqq

New Member
How to detect root folder in URI when using apache mod_alias and mod_rewrite?I have an website running on a sub folder in of the document root for example /var/www/this/an/other/dir in this folder I have a .ht_access file with mod_rewrite rules to redirect everything to index.php\[code\]# Do nothing if the file (s), link (l) or (d) existsRewriteCond %{REQUEST_FILENAME} -s [OR]RewriteCond %{REQUEST_FILENAME} -l [OR]RewriteCond %{REQUEST_FILENAME} -dRewriteRule ^.*$ - [NC,L]# Redirect everything else to index.phpRewriteRule ^.*$ index.php [E=PORT:%{SERVER_PORT},NC,L]`\[/code\]I also have set up an alias for easy access\[code\]alias /foo /var/www/this/an/other/dir\[/code\]Now when I go to the address http://host.com/foo/bar/ how can I detect that /foo is the root folder of my URI?
 
Back
Top