Reputation: 221
I am trying to create a htaccess rewrite for achieving following
I have a url like this http://www.example.com/directory/test.php and wanted to show the contents of this page when http://www.example.com/directory/test.html
I tried following but did not work. Could anyone please let me know what I am doing wrong here
RewriteEngine On
RewriteBase /directory/
RewriteCond ^directory/test.html/?$ [NC]
RewriteRule ^(.*)http://www.examle.com/directory/test.php [NC,L]
Any help would be appreciated
Upvotes: 1
Views: 9713
Reputation: 18671
You can use:
RewriteEngine On
RewriteRule ^directory/test\.html/?$ directory/test.php [NC,L]
Upvotes: 4