Solved

.htaccess file again (only html files)

Posted on 2014-09-26
2
87 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
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 demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

15 Experts available now in Live!

Get 1:1 Help Now