How can i add .php at the end of url using .htaccess and below is .htaccess code
.htaccess
<IfModule mod_rewrite.c>
# Enable Rewriting
RewriteEngine on
RewriteRule ^search/(.*)/?$ search.php?loc=$1
</IfModule>
search.php
if the url is
search.php?loc=miami
echo "Location : " . $_GET['loc'];
output: Location : miami
but how can get search.php/miami.php in the end ?
locGET parameter doesn't have .php, you would need to request search.php?loc=miami.php for that. What exactly are you trying to achieve here?search/miamiintosearch.php?loc=search.php/miami.php?