Solved

Symlink in root web

Posted on 2006-07-13
4
256 Views
Last Modified: 2010-03-04
Is it possible to have a symbolic link in the root web that points to a .htaccess file outside of the root web and still be able to use mod_rewrite?

/var/www/.htaccess
/var/www/html/{symlink}

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://domain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|js)$ - [F,NC]
0
Comment
Question by:ray-solomon
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:caterham_www
ID: 17115981
Why a symlink to that .htaccess file? /var/www/.htaccess is on the way to /var/www/html/, so it will be executed, if there are no RewriteRules present in /var/www/html/.htaccess or below. Otherwise you must use the RewriteOptions directive.
0
 
LVL 10

Author Comment

by:ray-solomon
ID: 17116060
I intend to have no .htaccess file in the root web, just a symlink to it. The rewrite rules will be in the .htaccess file below the root web.

My reasoning is to create a shell script that will add/delete rewrite rules to it for me automatically upon certain events. I do not want the .htaccess writeable in the root web to make it safer.

So you say it is okay to go about this?
0
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 17118445
Yes, but if you're smylinking from
/var/www/html/{symlink} to
/var/www/.htaccess and not to
/something/complete/other/.htaccess, you won't need a symlink, because for a request of /var/www/html/abc, /var/www/.htaccess will be processed automatically.
0
 
LVL 10

Author Comment

by:ray-solomon
ID: 17119657
okay thanks.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IBM HTTP Server Log rotation 5 143
transferring settings for apache and mysql 2 83
LAMP problem identifier tool ? 9 108
htaccess restrict subdomain 4 84
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now