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 challenge #5

Closed
ekandreas opened this issue Sep 26, 2015 · 7 comments
Closed

.htaccess challenge #5

ekandreas opened this issue Sep 26, 2015 · 7 comments

Comments

@ekandreas
Copy link

I'm concerned about the .htaccess configuration.
When using this statement everything works well, but also unauthenticated access is slipped through:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</IfModule>

If I put a "last" in the rule, the pages is protected with 404, but then also the authenticated (with token) requests fails:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
  SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</IfModule>

So I need som hint of what could go wrong and what to do.

Apache/2.4.12 (Ubuntu)
5.6.10-1+deb.sury.org~trusty+1

@ekandreas
Copy link
Author

I'm using a Vagrant server and a Bedrock setup with WP installed aside with composer.

@Tmeister
Copy link
Owner

Can you please tell me what Vagrant Image are you using to try to replicate the server on my local..

@ekandreas
Copy link
Author

Oh, thanks!
It's the latest Scotchbox, https://box.scotch.io. No modifications, just a Roots Bedrock as the "public" folder.

@ekandreas
Copy link
Author

Do youwant me to make a provision setup?

@ekandreas
Copy link
Author

You can use this repo to get up and running quick: https://github.com/ekandreas/scotch-bedrock

@ekandreas
Copy link
Author

Perhaps #6 has something to do with my issue?

@ekandreas
Copy link
Author

Think there was a missunderstanding from my side. The API is open for every get request. I wanted to protect the whole WP-API from access.

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