I am getting a really strange error that - for the life of me - I cannot track down...
Here is what is happening...
The user starts from his/her Inbox located here...
http://local.debbie/account/messages/incoming
The user click on a given Private Message in his/her Inbox and is taken to the PM to a URL similar to this...
http://local.debbie/account/view-pm/incoming/4
Next, the user decides he/she wants to back up to the Inbox, and so (on my Mac) chooses Command + Back-Arrow.
While the browser goes back one page to the Inbox, and everything loads just fine, in the background, the browser or my code is apparently throwing a 404-Error.
I know this because in my .htaccess file I have this code...
Code:
#Handle Page Not Found.
ErrorDocument 404 "/utilities/page-not-found.php"
...and that script is running which sends me an e-mail saying there was an issue.
Like a lot of things late in the game of developing my website, it is hard to troubleshoot if you don't have my entire code base, and yet I am hoping someone out there has seen something similar and may have som ideas of how to fix this?!
It would be a real bummer if I - as the Admin - get an e-mail every time someone backs up from a PM to their Inbox!!!!!
That will ultimately come down to your rewrite rules. If I had to guess, one of them has a trailing / on it, and the rewrite engine either only handles it with the trailing front slash or doesn't handle it. One or the other would trigger an error since it is now looking for a directory which presumably doesn't exist.
That will ultimately come down to your rewrite rules. If I had to guess, one of them has a trailing / on it, and the rewrite engine either only handles it with the trailing front slash or doesn't handle it. One or the other would trigger an error since it is now looking for a directory which presumably doesn't exist.
Fou-Lu, did you see my latest post (i.e. Reply #3)??
And what is your question to go with that? It matches the output $from variable you have created.
I am wondering all the mod_rewrites I used - only a dozen really - are worth the trouble they can cause?!
Okay, I think I am making some progress thanks to your lead, so here is where I am stuck now...
In my Web Root I have a directory called "uploads" which holds Member's profile photos plus a png to handle if a photo is "pending approval" and one if the Member has no photo.
For whatever reason, I had the wrong filename in my code, and so I corrected below...
PHP Code:
// Check for No Image.
if (is_null($fromPhoto)){
$fromPhoto = "NoImageAvailable_100x77.png";
}
if (is_null($toPhoto)){
$toPhoto = "NoImageAvailable_100x77.png";
}
So, when I re-run my code with an exit() to isolate things, in View Source I see...
Code:
src='/uploads/NoImageAvailable_100x77.png'
If I type this in the URL I get a 404-Error...
local.debbie/uploads/NoImageAvailable_100x77.png
So to me that means that the HTML that is trying to display my "No Image Available" thumbnail is crashing things...
The best thing I can think, is that is very liberal mod_rewrite could be causing an issue...
Code:
#-------------------------------------------------------------------------------
#PRETTY: finance/
#UGLY: articles/index.php?section=finance
#Rewrite only if the request is not pointing to a real file (e.g. add-comment.php, index.php).
RewriteCond %{REQUEST_FILENAME} !-f
#Match any kind of Section. PHP will decide if it's valid or not.
RewriteRule (.+)/$ articles/index.php?section=$1 [L]
You require the / at the end of it. Without it it will consider it a directory.
No, I just have it like that in one place, which is probably a whole long discussion in itself...
For each "Article Section" in my website, which is a "navigation tab" and a landing page containing a summary of each Article, right or wrong, I adopted this format in the URL...
http://local.debbie/finance/
http://local.debbie/legal/
http://local.debbie/management/
To me, it seemed like a good idea at the time, because ending a URL with a slash denotes that you are looking into a directory, and I guess my "Finance Landing page" is a "directory" of sorts?!
It's much too late to change that for v2.0, but if you think my convention is a bad idea or misleading, I guess I could re-work it for v3.0
Your rewrite can just take /? on it to make it optional.
The source image paths are irrelevant. Unless its somehow matching your rewrite rules which is very easy to do. Your current rules only check to see if a file matches, otherwise it goes ahead and rewrites. Assuming the style is overall the same, not matching a filepath for an image would attempt to rewrite it. I wouldn't think that would cause a 404 on a page though; all that should do is show a broken image link since the image itself is a 404.