logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.4 : rewrite does not work for one of my locations
Author
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Fri 22 Nov '13 21:25    Post subject: Apache 2.4 : rewrite does not work for one of my locations Reply with quote

Hi all,

After a few years with apache 2.2 I decided to try apache 2.4
Both are running on windows 7.
I had to recompile my modules against the new api, but that was succesful.

I am now confronted that the rewrite rule for one of my locations :

Code:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/mijnvital(.*) https://%{SERVER_NAME}/mijnvital$1 [R,L]


Code:
<Location /mijnvital>
     Options Indexes FollowSymLinks MultiViews ExecCGI
     SetHandler vl910-handler
#     SSLRequireSSL 
     Require all granted
</location>


Does not work anymore.

Apache is running with loglevel 6/8 for rewrite :

Code:
C:\Program Files (x86)\Apache Software Foundation\Apache24\bin>httpd
[Fri Nov 22 20:17:35.549179 2013] [core:trace3] [pid 1908:tid 728] core.c(3034):
 Setting LogLevel for all modules to trace6
[Fri Nov 22 20:17:35.549179 2013] [core:trace3] [pid 1908:tid 728] core.c(3061):
 Setting LogLevel for module mod_rewrite.c to trace8


However, I do not see anything in the error log :
http://pastebin.com/jhKHybgf

This is my complete .conf :
http://pastebin.com/QgnydHfF

Can anyone help me ?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3093
Location: Hilversum, NL, EU

PostPosted: Fri 22 Nov '13 22:15    Post subject: Reply with quote

What response does the client get ? 404 ?

Maybe the v1910 handler is causing it, see what you get when removing it.
Back to top
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Sat 23 Nov '13 8:19    Post subject: Reply with quote

No, the response is just 200 and the webpage is displayed. But it is not redirected to https as was the goal of the rewrite.
I will try with the handler removed en report back to you.
Back to top
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Sat 23 Nov '13 9:54    Post subject: Reply with quote

With the VL910 handler disabled, the same result. The webpage I have put in <documentroot>/mijnvital is displayed, but no redirection is done to https.
Btw., this worked fine under apache 2.2
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 23 Nov '13 11:46    Post subject: Reply with quote

This works for me

RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteRule ^/mijnvital(.*) https://%{SERVER_NAME}/mijnvital$1 [L,R]
Back to top
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Sat 23 Nov '13 12:26    Post subject: Reply with quote

Even that does not work. Strange thing is I see no log lines for any rewrite action.
Back to top
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Sat 23 Nov '13 21:06    Post subject: Reply with quote

Now I am very puzzeled.
After adding options +followsymlinks :

Code:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/mijnvita(.*) https://%{SERVER_NAME}/mijnvita$1 [L,R]


It works for http://mijnvita.nl/mijnvita
but not for http://www.mijnvita.nl/mijnvita

But still nothing in the log Confused

(left out last letter in links)
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3093
Location: Hilversum, NL, EU

PostPosted: Sat 23 Nov '13 21:49    Post subject: Reply with quote

2.4 : Mixing Options with a + or - with those without is not valid syntax.

Sorry I did not noticed it.
Back to top
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Sat 23 Nov '13 22:43    Post subject: Reply with quote

Is the module maybe compiled with the -DREWRITELOG_DISABLED compiler option ?
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 685

PostPosted: Sat 23 Nov '13 23:19    Post subject: Reply with quote

I assume you mean mod_rewrite. No
Back to top
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Sun 24 Nov '13 15:28    Post subject: Reply with quote

It is a pitty I cannot get this working on apache 2.4
It is also a blocking issue which prevents me from upgrading from 2.2 to 2.4
I wanted to do this for tls v1.2 support, but I guess I have to wait for maybe a next release or so.
Back to top
mesa57



Joined: 22 Nov 2013
Posts: 12
Location: Mijdrecht, Netherlands

PostPosted: Sun 24 Nov '13 20:13    Post subject: Reply with quote

Steffen, I finally got it working.
I do not know why exactly.
I compared my configurations :

http://pastebin.com/raw.php?i=4u995QuQ

Left one did not work, right one does Confused

But of cause I am happy now ... Smile
Back to top


Reply to topic   Topic: Apache 2.4 : rewrite does not work for one of my locations View previous topic :: View next topic
Post new topic   Forum Index -> Apache