Solved

Rewrite directory to 404/index.htm

Posted on 2008-10-22
1
228 Views
Last Modified: 2010-03-04
Hello,

I want to redirect all requests from applicationDir/ to 404/index.htm

I only have access to mod_rewrite through a .htaccess file.

All these should be rewritten:
         applicationDir
         applicationDir/
         applicationDir/page.html
         applicationDir/sub/dir/page.html

0
Comment
Question by:hankknight
1 Comment
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 22781941
In a /.htaccess:
RewriteEngine on

RewriteRule ^applicationDir /404/index.htm [L]
 
 

^ = start of string, followed by the string applicationDir and maching anything following right to applicationDir. If applicationDirFoo should not be matched, the RegEx needs some modification:
 

RewriteRule ^applicationDir($|/) /404/index.htm [L]

Open in new window

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

21 Experts available now in Live!

Get 1:1 Help Now