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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -