M
M
Mikhail Lyalin2018-01-24 16:48:44
Apache HTTP Server
Mikhail Lyalin, 2018-01-24 16:48:44

Correct operation of the logo on the pages of the site as a link to the main page?

The site uses the following code to check whether the call is from the main page of the site or not:

<!--#if expr="$DOCUMENT_URI=/^\/index.shtml/" -->
<img src="/pic/logo.gif" alt="сайт">
<!--#else -->
<a href="/index.shtml"><img src="/pic/logo.gif" alt="сайт [переход на главную]" title="сайт [переход на главную]"></a>
<!--#endif -->

On Apache 2.2 the code works without crashing, but on Apache 2.4 and newer it gives an error [an error occurred while processing this directive] !
Tell me how to correct the code to work on any versions of Apache?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Lyalin, 2018-01-26
@mr_jok

m.b.,

<If "%{DOCUMENT_URI} == m#^/index.shtml$#">
    <img...>
<Else>
    <a href="/index.shtml"><img...</a>
</If>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question