Solved

Urgent: How to RedirectMatch 301 all files on server to new file extension

Posted on 2006-07-10
3
230 Views
Last Modified: 2010-03-04
HI All -

All the files on out webserver were recently changed from .html to .php due to various platform and programming reasons.  The directory structure and filenames were all preserved however, so I would like to be able to set a site wide permanent redirect so that any request made to a .html page (in any directory) will be redirected to that same page, with a .php extension instead.  

Is it possible to do this by setting the instruction in the httpd.conf file? If so, what would the complete rule be?  I know I can do this via .htaccess files in each directory, but I'd rather not have to do that, as there are *many* dirs and subdirs on the server.  

The site is hosted on a VPS and mod_rewrite is installed.  

Thanks in advance for any assistance!
0
Comment
Question by:betagirl
3 Comments
 
LVL 4

Accepted Solution

by:
Tol_cv earned 500 total points
ID: 17080284
RewriteEngine on
RewriteRule ^(.*)\.html$    $1.php  [L,R]
0
 

Author Comment

by:betagirl
ID: 17083081
Hello Tol -

Thank you for your reply.  I need the redirect to be seen as a permanent redirect for search engines, can I add a 301 argument to that it still function properly - ie

RewriteEngine on
RewriteRule ^(.*)\.html$    $1.php  [L,R=301]

Thanks again!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now