Solved

Rewrite directory to 404/index.htm

Posted on 2008-10-22
1
232 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

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…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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