.htaccess - htaccess - One clean URL working but not the other -
htaccess files have never been strong point me unfortunately.
i'll jump right in:
#turn rewriteengine on options +followsymlinks rewriteengine on #canonicalize url rewritecond %{http_host} !^www\.domain-removed\.com [nc] rewritecond %{http_host} !^$ rewriterule ^/?(.*) http://www.domain-removed.com/$1 [l,r,ne] #add trailing slash rewritecond %{request_uri} !(/$|\.) rewriterule (.*) %{request_uri}/ [r=301,l] #clean urls rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule ^themes/([a-za-z0-9]+)/$ themes/view.php?theme=$1 rewriterule ^account/([a-za-z0-9]+)/$ account/index.php?page=$1
so going domain.com/themes/theme-name/
, domain.com/themes/view.php?theme=theme-name
works fine , both show same page/results. however, going domain.com/account/index.php?page=page
works going domain.com/account/page/
doesn't, returns 404 not found.
page
variables can things such login
, create
, dashboard
, logout
etc. index.php
in account directory process variable.
it's confusing me why doesn't work it's same situation, under different directory , different file name, both declared in rule. i'm doing wrong?
edit
i've tried doing , defining pages, so:
rewriterule ^account/login/$ account/login.php rewriterule ^account/logout/$ account/logout.php rewriterule ^account/create/$ account/create.php rewriterule ^account/dashboard/$ account/dashboard.php
but still returns 404
i tried out locally , couldn't reproduce it. account works fine.
i had problems redirect domain-removed.com. sure want redirect requests domain?.
follow ravi thapliyal's answer.
the other points obvious:
please make sure spell name of fold 'account' , index.php correctly
when trying
rewriterule ^account/login/$ account/login.php
make sure login.php exists.
Comments
Post a Comment