php - 301 htaccess redirect specific pages with extensions to no extension -
i 301 redirect specific file extension no extension , rule htaccess file looks this:
redirect 301 /myoldfile.php /my-new-file
but, when upload htaccess file, website redirects me link , generates error:
www.domain.com/my-new-file?myoldfile.php
so, appreciated, thanks
have way:
rewriteengine on rewritebase / rewriterule ^myoldfile\.php$ /my-new-file [l,nc,r=302] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?$1
make sure test after clearing browser cache.
Comments
Post a Comment