954,242 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

htaccess file help

I would like a .htaccess file which rewrites .php files as .htm files, however, if the .php file doesn't exist - try simply opening the .htm file with the same name.
It also needs to do a 301 redirect for anyone visiting any page on a certain domain (using same webspace). If that makes sense...

This is what I have so far:
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.htm$ $1.php [L]

Which changes .php to .htm

And I've been trying to use: RewriteCond %{SERVER_NAME} ^*example.co.uk*
RewriteRule ^/$ <a href="http://www.anotherexample.co.uk/">http://www.anotherexample.co.uk/</a> [L]

But it doesn't really work..

Any help would really be appreciated.

Regards,
Martin

martinkorner
Junior Poster
102 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 
Michael_Knight
Posting Whiz in Training
271 posts since Jan 2008
Reputation Points: 24
Solved Threads: 13
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: