Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.htaccess issue (documentation suggestion) #95

Open
KenYN opened this issue Aug 8, 2012 · 1 comment
Open

.htaccess issue (documentation suggestion) #95

KenYN opened this issue Aug 8, 2012 · 1 comment

Comments

@KenYN
Copy link

KenYN commented Aug 8, 2012

On one of the servers I have set up Tonic on, I needed to add this to .htaccess:

RewriteBase /~kenyn/tonic

Without that line, Apache was expanding the /~kenyn/tonic/ part of URLs to /home/kenyn/public_html/tonic/dispatch.php/ and giving me a 404 Not Found error.

@drkibitz
Copy link
Contributor

drkibitz commented Jul 1, 2013

@KenYN I'm curious what your tonic Application options looks like. Are you passing baseUri, mount, are you passing an explicit uri? Have you taken a look at this https://github.com/peej/tonic/blob/master/src/Tonic/Request.php#L185-L197 you can see if not passing an explicit uri to options, it first uses apache's REDIRECT_URL, which is set by mod_rewrite, and other ways. For instance, I am running php through cgi, and using mod_rewrite. So my version of REDIRECT_URL is always incorrect. To get around this, I just pass 'uri' => parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), explicitly as an option.

I tried setting my RewriteBase in .htaccess like you, but doesn't seem to have any effect for cgi. What I am doing is fine, but just curious if you had any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants