regex - htaccess mod rewrite - rewrite rule -
i ask following: have example rule mod_rewrite:
rewritecond %{request_filename} !-f rewritecond %{request_filename}.php -f rewriterule ^(.*)$ $1.php [nc,l] i want rewrite url www.x.cz/word www.x.cz/word.php
this works, problem arise in case, if url example www.x.cz/word/xxx (shortly after slash other text string). there error 500. how solve problem? (i server return 404 or same referring url www.x.cz/word.php - if there not string).
thank willingness.
you can tweak regex this:
rewritecond %{request_filename} !-f rewritecond %{request_filename}.php -f rewriterule ^([^./]+) $1.php [l] this rewrite both /word/xxx , /word/ /word.php
Comments
Post a Comment