Solved

Rewrite directory to 404/index.htm

Posted on 2008-10-22
1
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use of SSL Certificates - http vs https 3 90
how to use external config file with Spring MVC 4 156
Domino Website - Redirection 12 98
setup wamp server for first time 2 101
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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