Closed RanniSch closed 10 months ago
Tested with: http://localhost:8000/diversion.html does a redirect (correct)
PROBLEM http://localhost:8000/subdir/ does a redirect to / but still shows http://localhost:8000/subdir/ @MaxIhme config: location /subdir { return /; }
Ranja: I get 403 error, when trying http://localhost:8000/subdir/ at MaxIhme EDIT Max: That is one point I had to decide when not knowing what is better. The redirect (named return in config) redirects to another location, but it does not take the config of that location... and location subdir as you used it here has no index and no autoindex, so then it's forbidden to look into the directory. I think it's better it gets the config from that new location, but that can provoke an infinite return loop. I will think...
Main Updated:
after every try I had to delete the browser cache, because it remembers the redirection -> configuration, Privacy and safety -> delete browser data
I used default config:
...
location /
{
allowed_Methods GET POST;
index index.html;
#autoindex on;
}
location /static_website
{
allow_methods GET;
index static.html;
}
location /subdir
{
return /;
}
tried: http://localhost:8000/subdir ->should lead to http://localhost:8000/index.html (because of index in location / in config) and tried: http://localhost:8000/subdir/static_website/ ->should lead to http://localhost:8000/static_website/ and tried: http://localhost:8000/subdir/static_website ->should lead to http://localhost:8000/static_website/ ( / missing, not really ok, but I leave it now ) and http://localhost:8000/subdir/static_website/static.html should lead to -> http://localhost:8000/static_website/static.html
TESTED WITH ALL test that you both have done to me it seems to work now without a problem!
TESTED WITH ALL, for me only http://localhost:8000/subdir/static_website/static.html should lead to -> http://localhost:8000/static_website/static.html
The rest ends in 403. So maybe we should eval on Lukas machine?
I will rerun this case at my work and say what happens maybe i tested it wrong before
It all works. I think I had issues with the repository. I close this issue now.
Works now
Tested with: http://localhost:8000/diversion.html