Solved

.htaccess file again (only html files)

Posted on 2014-09-26
2
92 Views
Last Modified: 2014-09-27
I'm working on a .htaccess file and it is redirecting everything.  How could I change it so that it only redirects .html files?

RewriteEngine on
RewriteRule (.*) http://newsite.com/ [R=301,L]

Open in new window

0
Comment
Question by:hrolsons
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40346779
What are you wanting to redirect to?
This is the syntax...
RedirectMatch 301 (.*)\.html$ http://newsite.com

Open in new window

0
 

Author Closing Comment

by:hrolsons
ID: 40347884
I wanted all .html pages redirected to the root of the new site and your suggestion worked perfectly.  Thank You!!!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

815 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

11 Experts available now in Live!

Get 1:1 Help Now