In my web application htaccess is able to translate seo friendly urls of the form
/e-dmis/home
/e-dmis/system-admin/groups
/e-dmis/system-admin/standard-lists/accounting/COA
....
....
TO
/e-dmis/index.php?content=home
/e-dmis/index.php?content=system-admin/groups
/e-dmis/index.php?content=system-admin/standard-lists/accounting/COA
....
....
However I am caught in a situation where I need to redirect to page using jquery.For example,
var root = location.protocol + '//' + location.host;
window.location.href=root+'/e-dmis/home';
To my suprise,window.location.href
is always taking me to the index page,that is,/e-dmis/index.php
- removing the 'content' parameter.
You assistance will be greatly appreciated as it will shorten hours of googling on web about this.
Here is the .htaccess file:
Options -MultiViews
# Turn on rewriting
RewriteEngine On
# Starting with /e-dmis
RewriteBase /e-dmis
# If there's no file that matches the request
RewriteCond %{REQUEST_FILENAME} !-f
# *nor* a directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)/?$ index.php?content=$1 [L,QSA]