mod rewrite - .htaccess mod_rewrite add "/" to the end of url -
this .htaccess code:
rewritebase /kajak/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^moduli/([^/]+)/(.*)$ moduli/$1/index.php/$2 [l]
now /
appended every url. example, http://127.0.0.1/moduli/novice
becomes http://127.0.0.1/moduli/novice/
.
how can prevent getting /
@ end?
while not know answer question, note 2 oddities question , code may related problem @ hand.
with rewritebase have in code, rules should not being triggered.
while new regex myself, @ ([^/]+) , little confused why capturing it. know ^ matches start of string, never true since have 1 @ real start of string.
this being said, write code below:
rewritebase /moduli/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)/(.*)$ $1/index.php/$2 [l]
this rewrite urls below:
http://www.website.com/moduli/novice/view http://www.website.com/moduli/novice/index.php/view
based on block of code, seems trying do. if not, sorry.
Comments
Post a Comment