At first I used IIS server for PHP, so I’m new to Apache (Windows platform). I am in some puzzle related with URL rewrite. As in my .htaccess file I use the below code for URL Rewrite.
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.aspx$ $1.php [nc]
Now If I browse a .php page with .aspx extension, it works well. eg If I browse
http://www.example.com/guwahati.php => http://www.example.com/guwahati.aspx (both URL works.)
But I want it automatically. Like if I type http://www.example.com/guwahati.php, it will automatically convert to http://www.example.com/guwahati.aspx, is it possible ? also URL rewritting is not working on my localhost. may anyone help me please.
It is possible, but by using redirect headers, not URL rewrites. Actually you could do an URL rewrite that redirects to a single file that replaces the target extension with aspx and then redirects to it. You may need to enable
mod_rewritein order for it to work.