Solved

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

Posted on 2006-07-10
3
231 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
local dns 2 152
Why can I not access my httpd.conf from my WAMP menu... 9 66
Increase size of permitted URI 4 48
Virtual host in apache 31 90
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

17 Experts available now in Live!

Get 1:1 Help Now