RewriteCond CondPattern file attributes difference between "-h", "-l" and "-L"?

See: https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond


-h
Is symbolic link, bash convention.
See -l.


-l
Is symbolic link.
Treats the TestString as a pathname and tests whether or not it exists, and is a symbolic link. May also use the bash convention of -L or -h if there's a possibility of confusion such as when using the -lt or -le tests.


-L
Is symbolic link, bash convention.
See -l

What are the differences between these three?

"-h" has "bash concention" and "-l" not. But what is the difference in practise? Can someone give me an example of the difference?

And why it's "-L" and not "-H"? "-L" is about the bash convention, but "-l" not. However, "-h" is. So then I would expect "-H" instead of "-L".

I don't need it for something right now, but I'm trying to understand the Apache documentation.
Maarten BruinsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Do yourself a favor and use...

ln -s

Open in new window


Which will generate a soft link.

Usually -L means the same as -l. There is no -H.

As to why no -H, the answer is same as always with Linux... because... meaning at some point in time, maybe before you were born, someone made up some oddball convention/name, which made sense to them, then the convention/name stuck. There is no rhyme or reason to this. If you think you really must know, then open a ticket with Apache or BASH + ask about the historical background of your interest. There might be an old timer who can answer your question.

Below shows how to create links. What you mention above is all about testing links.

Using hard link types can create massive debugging + backup problems + many times guessing disk space used will be wrong (depending on tool used).

So think of soft links as aliases you can see + hard links are invisible...

Here's an example...

# text file...
imac> cat test.txt
Test data file...

# create a soft + hard link
imac> ln -s test.txt foo.txt
imac> ln -h test.txt foo1.txt

# see the difference...
# soft link is visible
# hard link is invisible, so both file directory entries point to the same first inode in test.txt
# with soft links, if you remove test.txt (original file), then the soft link dangles, returning no data
# with hard links, if you remove test.txt, then foo1.txt still exists, returning data of file.
imac> ll test.txt foo*.txt
-rw-r--r--  1 david  staff   3.6K Jul 22 19:56 foo.1.txt
lrwxr-xr-x  1 david  staff     8B Aug 30 07:06 foo.txt@ -> test.txt
-rw-r--r--  2 david  staff    18B Apr  6  2017 foo1.txt
-rw-r--r--  2 david  staff    18B Apr  6  2017 test.txt

Open in new window


With Apache + almost every other Linux tool, best to always use soft links.
Maarten BruinsAuthor Commented:
You're sating that -L means the same as -l. If that's true, then all three (-L, -l, -h) are the same.

Then why the description is different?

Is symbolic link.
Is symbolic link, bash convention.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.