Solved

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

Posted on 2006-07-10
3
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

615 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