This is a discussion on mod_rewrite question within the Apache Web Server forums, part of the Web Server and Related Forums category; Let's say I've got a site for which I want to do rewriting for all requests to a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Let's say I've got a site for which I want to do rewriting for all
requests to a particular subdirectory and everything beneath it. For sake of example, we'll use "mydir" as the name of the directory. Further, I need the rewrite condition to be case-insensitive so that the condition does catch someone doing http://mysite.com/MyDir and other variations. I tried this, but it doesn't seem to be working correctly. That is, it works for http://mysite.com/mydir but I get a 404 for http://mysite.com/MyDir RewriteCond %{DOCUMENT_ROOT}mydir%{REQUEST_FILENAME} [NC] Any suggestions? Any help would be appreciated. Thanks, Sean |
|
|||
|
On Jun 22, 5:01 pm, Sean <seanmichaelbr...@gmail.com> wrote:
> Let's say I've got a site for which I want to do rewriting for all > requests to a particular subdirectory and everything beneath it. For > sake of example, we'll use "mydir" as the name of the directory. > Further, I need the rewrite condition to be case-insensitive so that > the condition does catch someone doinghttp://mysite.com/MyDirand > other variations. > > I tried this, but it doesn't seem to be working correctly. That is, > it works forhttp://mysite.com/mydirbut I get a 404 forhttp://mysite.com/MyDir > > RewriteCond %{DOCUMENT_ROOT}mydir%{REQUEST_FILENAME} [NC] > > Any suggestions? > > Any help would be appreciated. > > Thanks, > > Sean Have you read the manual pages for rewrite, the condition you use doesnt appear to be "standard", RewriteCond ^/mydir [NC] would be. |
|
|||
|
On Jun 22, 5:01 pm, Sean <seanmichaelbr...@gmail.com> wrote:
> Let's say I've got a site for which I want to do rewriting for all > requests to a particular subdirectory and everything beneath it. For > sake of example, we'll use "mydir" as the name of the directory. > Further, I need the rewrite condition to be case-insensitive so that > the condition does catch someone doinghttp://mysite.com/MyDirand > other variations. > > I tried this, but it doesn't seem to be working correctly. That is, > it works forhttp://mysite.com/mydirbut I get a 404 forhttp://mysite.com/MyDir > > RewriteCond %{DOCUMENT_ROOT}mydir%{REQUEST_FILENAME} [NC] > > Any suggestions? > > Any help would be appreciated. > > Thanks, > > Sean well it would if I got it right first time ReWriteCond %{REQUEST_URI} ^/mydir [NC] |
| Thread Tools | |
| Display Modes | |
|
|