Solved

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

Posted on 2006-07-10
3
229 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
Comment Utility
RewriteEngine on
RewriteRule ^(.*)\.html$    $1.php  [L,R]
0
 

Author Comment

by:betagirl
Comment Utility
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

13 Experts available now in Live!

Get 1:1 Help Now