Solved

Mod Rewrite: .xyz to 404

Posted on 2008-10-21
1
231 Views
Last Modified: 2012-05-05
I want to rewrite all pages with a .xyz extention to /404/index.htm

So:
http://www.example.com/sub/dir/page.xyz

Should be redirected to:
http://www.example.com/404/index.htm



0
Comment
Question by:hankknight
1 Comment
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 22771861
For a redirect add the R flag ([R,L]], but in all cases, a http status code 200 would be issued but not 404 not found.
RewriteEngine on

RewriteRule \.xyz$ /404/index.htm [L]

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

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

12 Experts available now in Live!

Get 1:1 Help Now