Jump to content

Recommended Posts

Hi all. I don't know much at all about .htaccess and would appreciate help with a simple .htaccess script.

 

I have multisite Drupal set up. www.mysite.com points to ~/public_html. www.mysite.com/site2 also points to ~/public_html (via the symlink ~/public_html/site2). There is a ~/public_html/files directory. So www.mysite.com/files and www.mysite.com/site2/files point to the exact same directory. What I want to happen is this:

 

If someone navigates to www.mysite.com/files/[filename], direct them to ~/public_html/files/[filename]

If someone navigates to www.mysite.com/site2/files/[filename], direct them to ~/public_html/sites/www.mysite.com.site2/files/[filename]

where [filename] is either a filename or something like path/to/filename

 

Does anyone know how this could be accomplished, or know of a tutorial that might point me in the right direction? Thanks alot!

Link to comment
https://forums.phpfreaks.com/topic/98513-redirect-depending-on-directory/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.