top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Apache: Why is relative linking bad?

0 votes

I've been using relative links in content in the past without any trouble. It has been suggested this is a bad practice, but the reasons given I haven't found terribly convincing. I may be wrong, but it seems as though people are using relative linking as a scapegoat for generally bad practices.

Take the following article for instance:

The way I see it, if broken links are being deployed then testing isn't thorough enough. If a test environment is accessible to involved parties (e.g. spiders) then testing isn't controlled enough. If multiple paths exist to the same content without good reason, then the architecture is poor.

Looking around Google, this seems to be rather representative of the arguments. Relative links are bad because when they're combined with other issues that should never happen the results are undesirable. That's not good enough for me. Does anybody have a better reason?

posted Nov 4, 2013 by Jagan Mishra

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

The article you linked to is specifically about WordPress - defending their decision to make ALL links absolute links. I worked on a project (using Wordpress) that required that all URLs be relative unless absolutely necessary and we had to add a plugin to undo all of that linking.

answer Nov 4, 2013 by Dewang Chaudhary
Similar Questions
+2 votes

I'm trying to set DocumentRoot and the following directory directive relative to ServerRoot:

DocumentRoot "../web"

DocumentRoot is working, but the Directory directive is not. It won't match. If I change the directory directive to an absolute path it will work. Any idea how I can get this to work?

0 votes

Running Apache 2.4.7 and current configuration limiting access to a directory to only clients that can provide a trusted client certificate. Server is SSL host. Would like to modify configuration to allow "local" clients (, etc. as defined by Require local auth provider) to access the directory without authenticating with a client certificate. So the local host may access the directory without SSL client auth, but all others must authenticate with a client certificate or access is forbidden. What is the best/proper way to do this?

I would like to use modern directives (avoiding Allow, Deny, Order etc. from mod_access_compat) but I am not clear how to combine Require related directives with mod_ssl options like SSLVerifyClient.

Thanks in advance?

0 votes

I have two handlers to be accessed. My motive is to use the second handler if the first handler returns DECLINED.

I have tried various combinations of SetHandler, AddHandler and AddType but none has worked as overriding takes place in all of these combinations.

Is there any method in Apache to use more than one handler without overriding?

0 votes

I am a bit confused about the mod_rewrite documentation. It shows this rule to block hotlinking:

RewriteCond "%{HTTP_REFERER}" "!^$"
RewriteCond "%{HTTP_REFERER}" "!" [NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

however, I'd think a better rule would be:

RewriteCond "%{HTTP_REFERER}" "^$" [OR]
RewriteCond "%{HTTP_REFERER}" "!(www.)?*$" [OR,NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

if I want to block anyone manually typing in a link (no referer) + hotlinking (probably has a referer). Do i need the [OR] on the 1st
RewriteCond and not the 2nd one? It seems to work with OR on both conditions.

+1 vote

Just set up a FreeBSD jail to run httpd in it and all works good except these two, rewrite/proxy modules.

These are error logs excerpts:

[rewrite:crit] [pid 43447] (13)Permission denied: AH00666: mod_rewrite: could not init rewrite_mapr_lock_acquire in child 
MOD_PROXYÂ error: 
[proxy:crit] [pid 43447] (13)Permission denied: AH02479: could not init proxy_mutex in child 

Not sure permissions of what are being denied as html in document root is being served just fine when these modules are disabled.

I tried googling but found nothing but rubbish. Please help?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.