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

On initial setup, the error message about AllowOverride could use a note about the change to make. #1105

Closed
obra opened this Issue Dec 3, 2015 · 3 comments

Comments

Projects
None yet
5 participants
@obra
Copy link
Contributor

obra commented Dec 3, 2015

On initial setup, the error message about AllowOverride could use a note about the change to make.
Technical settings
Rewriting appears to be disabled. Usually this means "AllowOverride None" is set in apache2.conf which prevents Known's .htaccess from doing its thing. We tried to fetch a URL that should redirect to default.js, but got this response instead:

HTTP/1.1 404 Not Found
Date: Thu, 03 Dec 2015 19:30:35 GMT
Server: Apache/2.4.16 (Unix) PHP/5.5.27
Content-Length: 210
Content-Type: text/html; charset=iso-8859-1

<title>404 Not Found</title>

Not Found

The requested URL /js/canary.js was not found on this server.

Technical settings Rewriting appears to be disabled. Usually this means "AllowOverride None" is set in apache2.conf which prevents Known's .htaccess from doing its thing. We tried to fetch a URL that should redirect to default.js, but got this response instead:

HTTP/1.1 404 Not Found
Date: Thu, 03 Dec 2015 19:30:35 GMT
Server: Apache/2.4.16 (Unix) PHP/5.5.27
Content-Length: 210
Content-Type: text/html; charset=iso-8859-1

<title>404 Not Found</title>

Not Found

The requested URL /js/canary.js was not found on this server.

benwerd added a commit that referenced this issue Dec 3, 2015

@kylewm

This comment has been minimized.

Copy link
Collaborator

kylewm commented Dec 4, 2015

@wholewheattoast and I ran into this too! I was going to come file an issue and then see it's already been fixed, so awesome 👍

@benwerd benwerd closed this Dec 11, 2015

@tincho

This comment has been minimized.

Copy link
Contributor

tincho commented Oct 31, 2018

Hi there! Trying to deploy using Nginx, and inside a subdir... any workaround? Thanks!

EDIT:
with the latest version of Known I got rewrites working by adding this to my nginx vhost file:

location /js {
  rewrite ^/js/canary\.js$ /js/default.js break;
  rewrite ^/js/[0-9]+/(.*)$ /js/$1 break;
}

location /css {
  rewrite ^/css/[0-9]+/(.*)$ /css/$1 break;
}

location / {
  try_files $uri $uri/ /index.php?/$query_string;
}

honestly I don't know the equiv of Apache's .htaccess %{ENV:BASE} so if installing in a subdir, say /known, we'll have to prepend it to all paths, i.e:

location /known/js/ {
  rewrite ^/known/js/canary\.js$ /known/js/default.js break;
  rewrite ^/known/js/[0-9]+/(.*)$ /known/js/$1 break;
}

location /known/css {
  rewrite ^/known/css/[0-9]+/(.*)$ /known/css/$1 break;
}

location /known/ {
  try_files $uri $uri/ /known/index.php?/$query_string;
}
@mapkyca

This comment has been minimized.

Copy link
Member

mapkyca commented Oct 31, 2018

I do wonder whether subdirs may be the cause of some other installs, i.e. #2238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.