Mornin' folks...
Got something of a strange occurance that I don't understand - hoping y'all will be able to shed some light on the subject.
I've got a project I'm working on, and it's currently hosted in a subdirectory off my main site, ie: http://127.0.0.1/raweb/
I also have the directory admin/ under raweb, ie: http://127.0.0.1/raweb/admin/
The site is under password protection via raweb/login.php. When any page in the site is accessed without proper authentication, it redirects to the login page with a reference to itself, so I can send the user back to their intended page. Thus it would look like: http://127.0.0.1/raweb/login.php?ref=/raweb/admin/users.php
The issue I have is that whenever it redirects to a subdirectory, my CSS file doesn't load and the address bar remains at /login.php (with no attributes, even with a ref=blah is passed in).
Any ideas?
Below I've included some of the tests I've done and the results:
Base code with page vartest.php (same directory level as login.php):
$test = 'admin/reqcat.php';
$att = '?blah=blah';
header("Location: " . $test . $att);
exit();
Test 1: When $test = '/raweb/admin/reqcat.php' the CSS fails to load and the address bar remains the same, but the main code of reqcat.php executes just fine (including include() functions).
Test 2: When $test = 'admin/reqcat.php' the page loads fine and the address bar shows what it should.
Test 3: When $test = 'raweb/admin/reqcat.php' the redirect obviously fails as the address doesn't match up with the directory structure.
Test 4: When $test = '/admin/reqcat.php' the redirect again fails, I would assume because the directory structure doesn't match up, but here the address bar remains vartest.php.
I'm at a loss here. Any help would be greatly appreciated!
Cheers,
- Justin
Edit: I've also noticed that sometimes my "working" redirects will not update the address bar location? There doesn't seem to be a pattern with those though. Might be going to the same /raweb/page.php type address though.