htaccess rewrite rule

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

htaccess rewrite rule

Post by rajsekar2u »

Hi,

I want to rewrite the below url using htaccess file.

http://www.sitename.com/gallery.php

to

http://www.sitename.com/gallery.html

How to do this?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: htaccess rewrite rule

Post by requinix »

Code: Select all

AddType application/x-httpd-php .html
and rename the file to gallery.html.
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

Re: htaccess rewrite rule

Post by markusn00b »

Or, to answer the htaccess question:

Code: Select all

 
RewriteRule ^gallery.html$ gallery.php
 
Post Reply