php - Htaccess changing URL case if directory exists -
php - Htaccess changing URL case if directory exists -
the problem having when url contains directory exists, url getting changed the case of file.
more specifically, happening:
when go domain.com/cron/xxx in php script, uri be:
cron/xxx but if folder cron exists, uri be:
cron/xxx does know causes happen?
here .htaccess file:
rewriteengine on
#remove www. rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] rewritecond %{http_host} ^api rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php?uri=api/$1 [l,qsa] rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php?uri=$1 [l,qsa]
i'm not super versed in modrewrite, try:
rewritemap lc int:tolower and utilize in rule so:
rewriterule (.*) ${lc:$1} [r=301,l] php .htaccess
Comments
Post a Comment