apache - .htaccess file does'nt work properly -
i have create .htaccess in following way
rewriteengine on rewritebase /school1 rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (.*) index.php?path=$1 [l,qsa]
i mean when user hit 'school1/schools/schools'
contents of 'school1/index.php?path=schools/schools' working css js , images requests going school1/schools/[js|css|img]/...
per directory instead of school1/[js|css|img]
i m not getting why getting schools part url. if m fire http://demo.cwdesigns.org/school1/dashboard
renders when fire http://demo.cwdesigns.org/school1/schools/schools
please me have wasted long time problem. if want info please comment it.
update 1 per first answer have added base tag head section
<head> <base href="http://demo.cwdesings.org/school1" /> <meta charset="utf-8"> <title>student portal | dashboard</title>
but doesnt seem work.
because have /
's in url's path, browser incorrectly guessing relative url base of relative links. if browser thinks it's loading:
/school1/schools/schools
then relative base be: /school1/schools/
, relative links have prepended them. "relative" links relative page being loaded, , browser doesn't know rewrites.
to fix it, either make links absolute (starts http://your-domain.com/school1/
or /school1/
), or add relative base headers of pages:
<base href="/school1/" />
Comments
Post a Comment