mod_rewrite question

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-22-2007
Sean
 
Posts: n/a
Default mod_rewrite question

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

  #2 (permalink)  
Old 06-22-2007
shimmyshack
 
Posts: n/a
Default Re: mod_rewrite question

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.

  #3 (permalink)  
Old 06-22-2007
shimmyshack
 
Posts: n/a
Default Re: mod_rewrite question

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:54 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0