1

I'm trying to setup z-push which requires an alias /Microsoft-Server-Activesync that points to a file index.php in another directory outside of the VHost location. To test I setup a file in the same path and created the following

Alias /info /var/www/z-push/info.php
<Directory "/usr/share/z-push/">
    Options -Indexes
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

which doesn't work, but if I change the Alias to this

Alias /info.php /var/www/z-push/info.php

I can access it at the url example.com/info.php. Except I need to be able to have example.com/info for the ActiveSync stuff to work.

I assume I can fix this with a RewriteRule but I'm not having any luck with that.

Thanks.

EDIT :

Here is my virtual host config :

SetEnv RAILS_ENV production

RewriteEngine On

# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]

# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]

DocumentRoot /var/www/redmine/public/

<Directory /var/www/redmine/public/>
    Options +FollowSymLinks +MultiViews
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

Alias /Microsoft-Server-ActiveSync /var/www/z-push
<Directory "/usr/share/z-push">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

php_flag magic_quotes_gpc off
php_flag register_globals off
php_flag magic_quotes_runtime off
3
  • 1
    Not able to reproduce in lab, works fine. What is your Distro ?
    – krisFR
    Apr 4, 2014 at 22:42
  • Debian 7.4. The full vhost config is here pastebin.com/M08i9hZF. Apr 7, 2014 at 23:52
  • Maybe i've found the culprit, give it a try !
    – krisFR
    Apr 8, 2014 at 14:14

1 Answer 1

1

I think the culprit is this rewrite rule you have on top of your config file :

RewriteRule ^([^.]+)$ $1.html [QSA]

With this rule enabled, when you request example.com/info then the .html extension is added and your request becomes example.com/info.html.

And, of course, such a file does not exist. Extract from my log :

[error] [client xx.xx.xx.xx] File does not exist: /var/www/info.html

As it seems that this rewrite rule is needed by Rails, i won't suggest you to comment it out.

You could modify this rule, adding a rewrite condition, so that it will apply only if the requested page is not /info :

RewriteCond %{REQUEST_URI} !^/info
RewriteRule ^([^.]+)$ $1.html [QSA]
1
  • @Geoff Johnson Ok great ! I've updated your post with your config to make things more clear for others. In case you don't want (i cannot see any critical datas in this) tell me, i will delete it.
    – krisFR
    Apr 9, 2014 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .