Hi there,
Apache gives me 404 error when asking for /user - why?
When removing Boost line from .htaccess everything works fine. But when I put generated Boost content into .htaccess I see in log:
... "GET /user HTTP/1.1" 404 7343 "http://www.mydrupalsite.com/user" ...
Important - I still have login form on page. So it looks like a regular /user page, but in the Apache log I can see 404. How come? :) When I try to log in nothing happens - site is only reloaded, again with 404 code.
This is what I put into .htaccess - is everything ok with it?
### BOOST START ###
# Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
RewriteRule .* - [E=boostpath:normal]
# # Apache 2.4 bug workaround
# # Enables Search from home page https://drupal.org/node/2078595#comment-8724321
# RewriteCond %{REQUEST_METHOD} ^(POST)$
# RewriteCond %{REQUEST_URI} /
# RewriteRule .* / [S=3]
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$)
RewriteCond %{HTTPS} on [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=2]
# # Apache 2.4 bug workaround
# # Enables caching of index/ home page
# RewriteCond %{REQUEST_URI} ^/index\.php$
# RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html -s
# RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html [L,T=text/html]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###
Thanks.
Szy.
PS. Drupal 7 last stable, or last dev with Boost last stable or last dev - no difference.
Comments
Comment #1
szy CreditAttribution: szy commentedComment #2
szy CreditAttribution: szy commentedComment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedboost does not serve the user page ever (as the rule above shows. Otherwise one could end up with a username filled out from a failed log in attempt and it would be a security issue, at a guess I would say that the boost rules are either in the wrong place in the .htaccess file, or rules are being applied somewhere else and causing a failure on the S=n section which "skip" rewrite rules. It may also be that you are one of those affected by the apache 2.4 problems with rewrite rules and in which case we'd need a lot more details as this would be a new bug requiring a new workaround.
Comment #4
baronmunchowsen CreditAttribution: baronmunchowsen commentedI'm having this issue too with all user, admin pages. No forms submit (user or admin) - page reloads and I see a 404 log in my browser console.
Boost Rules are applied to a clean .htaccess file.
Boost Version 7.x-1.x-dev - 2014-May-04
Apache version 2.2.24
--edit--
While the non-admin pages are being cached and served by boost, the first time a page is accessed (before the page has been cached by boost) I also see a 404 error in the console for that particular page. Once boost serves the cached version, the 404 error no longer presents itself.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedcan you attach your .htaccess?
thank you.
Comment #6
baronmunchowsen CreditAttribution: baronmunchowsen commentedApologies for the delay.
Yes - here are the boost rules (in an otherwise untouched drupal .htaccess file)
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedRewriteRule .* - [S=3]
should be
RewriteRule .* - [S=2]
I think. The rules should be compared with the output that boost generates to paste in.
Comment #8
baronmunchowsen CreditAttribution: baronmunchowsen commentedThat seems to do the trick. Boost generates S=3, but replacing with S=2 fixes the issue.
Many thanks
Comment #9
szy CreditAttribution: szy commentedThen I reverted back to Boost 1.0 to use it.
Now, back to last dev and still have this horrible 404 for /user. #7 didn't help.
Probably more of you have it too, but you can't see this 404 in console. Because you still see the login page, so you don't even think, that loaded page gives 404 in console. Crazy.
Any other hint, please?
Szy.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedApache version, a log file showing it and then the next line which should be a redirect to index.php and the .htaccess file please. (although technically all drupal requests are 404 as /user doesn't exist it's just a rewrite.
Comment #11
szy CreditAttribution: szy commentedApache 2.2.16, Debian, Varnish, Memcache.
This is a *single* visit at /user - yes, it gives two lines in the log:
And the part of .htaccess - when I remove it, it works again:
Yes, I have my "drup.al" domain set there, instead of HTTPHOST, etc.
Thanks!
Szy.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedshould be
Comment #13
szy CreditAttribution: szy commentedIndeed! It works!
Thank you, Philip! :]
Szy.
Comment #14
salvadorweb89 CreditAttribution: salvadorweb89 commentedThanks James, it worked great!
Comment #15
aaldayel CreditAttribution: aaldayel commented#12 solved ajax problem, thanks Philip_Clarke!
Comment #16
prografr CreditAttribution: prografr commentedAَlso #12 solved my problem with ajax requests in Views module.