straup/privatesquare — Issue #4: Problems deploying somewhere besides a domain root
Author: markpasc
Created: 2012-02-15 05:52:26+00:00
State: open

I tried to set up privatesquare at a path on an existing domain, such as `www.example.com/privatesquare/`, using:

Alias /privatesquare /home/markpasc/privatesquare/www

but this made the `api/` endpoint return 404 responses. The Apache error page reads:

The requested URL /home/markpasc/privatesquare/www/api_rest.php was not found on this server.

and the error log gets a:

File does not exist: /var/www/home

so seems like the relevant `RewriteRule` in `www/.htaccess` makes Apache misinterpret the rewritten aliased file path `/home/markpasc/privatesquare/www/api_rest.php` as the URL `www.example.com/home/markpasc/privatesquare/www/api_rest.php` for some undoubtedly silly reason.

I also noticed the forms in the sign-up and sign-in pages use root-relative URLs instead of the `abs_root_url`, so the forms only submit to the correct location when deployed to the root of a domain. Additionally I wasn't able to get privatesquare to authorize against Foursquare properly until I switched it to be at the root of a domain.

Is it a boondoggle trying to run privatesquare somewhere besides `/` yet? I was only trying as I already have a domain with a few other apps like that, but can run it at a domain root for now. (The README mentions it should be possible but seems to me that statement could be boilerplate about Flamework.)