|
Posted by ZeldorBlat on 10/27/07 17:50
On Oct 27, 1:22 pm, dennis.spreng...@gmail.com wrote:
> * I'm trying to work out some rewrite rules that should do the
> following:
>
> case 1: a request to mysite.com:
> rewritehttp://www.mysite.com/files/sheets.ppt
> tohttp://www.mysite.com/sites/default/files/sheets.ppt
>
> case 1 - n: a request to othersite.com:
> rewritehttp://www.othersite.com/files/sheets.ppt
> tohttp://www.othersite.com/sites/othersite/files/sheets.ppt
>
> So, if a request comes in to mysite.com, /files/-urls need to be
> rewritten do /sites/default/files/sheets/ppt, since mysite is the
> default website on the server. Surfing to a file on any other website
> that is hosted on the server, needs to be rewritten to /sites/
> <name_of_site>/files/sheets.ppt
>
> Sheets.ppt is of course just an example of a file file.
>
> * I first tested my CMS (for which I need these rules) on my own
> little server @home, and found these rules to be working OK after
> spending hours on forums on apache and mod_rewrite:
>
> #http://localhost/mysite/files/*> /mysite/sites/default/files/*
> RewriteCond %{REQUEST_URI}-default ^/mysite/.+-(default)$ [NC,OR]
> #http://loclahost/<othersite>/files/* > /<othersite>/sites/
> <othersite>/files/*
> RewriteCond %{REQUEST_URI}-default ^(.+)(default)$ [NC,OR]
>
> But now I have no clue on where to begin anymore, since it has been a
> long time I researched mod_rewrite. Could somebody help me out? Any
> help is appreciated :-)
You're making it harder than you need to. Just use an alias:
Alias /files <path to the webroot>/sites/default/files
Navigation:
[Reply to this message]
|