Solved

Symlink in root web

Posted on 2006-07-13
4
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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