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.

  1. with rewritebase have in code, rules should not being triggered.

  2. 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

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -