Jump to content

Redirect depending on directory


johnnyk

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

Archived

This topic is now archived and is closed to further replies.

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