mod_rewrite question

mod_rewrite question

am 22.06.2007 18:01:21 von Sean

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

Re: mod_rewrite question

am 22.06.2007 19:08:12 von shimmyshack

On Jun 22, 5:01 pm, Sean 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.

Re: mod_rewrite question

am 22.06.2007 19:11:25 von shimmyshack

On Jun 22, 5:01 pm, Sean 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]