« first day (914 days earlier)      last day (4259 days later) » 

21:00
@rdlowrey on that note, did you read the Malazan Book of Fallen?
user895378
@NikiC I have not. Should I procure it immediately?
Group hug, yay!
Anonymous
I surely can't rely on SE mods if I ever wanted to know justice exists.
Anonymous
no offence ^
@phpNoOb You won't find justice. I think they can only hope to control the chaos
21:02
@phpNoOb Well, I guess you're lucky I didn't get elected then, my perception of justice is a bit different than yours it seems.
Anonymous
@MadaraUchiha I know what you call justice.
Anonymous
If only SE had the option to hide your reps, I would've gotten more respect in this room than I have had
@Gordon is easy going with you, for a third strike, I would have chat-banned you for a day pretty much on the spot.
Anonymous
mehhh, thats life
@MadaraUchiha I'll add 1.9 and 2.0 at the same time!
21:04
@phpNoOb If you stop acting like a 13-year-old, you would've gotten more respect in this room than you have had.
Cross jQuery compatible code.
noConflict() ftw
Also, no one is born with rep, we earn it.
Any idea where I can see the SVN log for the docs in PHP that are edited with the ExtJS based editor?
Like something in the web to peek what gets checked in?
@hakre Because it's still SVN? (I think)
21:05
@MadaraUchiha Yes last time I wanted to find out I think I searched for that SVN but didn't see any changes
Isn't the ExtJS editor merely an SVN client?
@hakre extjs?
@hakre By ExtJS you mean PhdOE i.e. edit.php.net?
PhdOE yes, the ExtJS based PHP doc editor.
@webarto it runs on ExtJs
21:06
@hakre its on the mailinglist
ah the mailinglist, I will take a look there
@Gordon Yes, just haven't seen anyone calls it like that :)
They usually call it that f* up thing...
anyone know of a PHP library (or core function) for function composition?
@igorw define "function composition"
21:08
@igorw monad style?
@webarto What advantages does SVN have over Git anyway?
compose($f, $g) => function ($args...) { return $f(apply($g, $args)); }
Ahh, no
@MadaraUchiha /me backs away slowly
I mean, the PHP community did select it for the docs, and it's not like moving to Git isn't a breeze, so what gives?
@MadaraUchiha news.php.net/php.internals/55293 seems to be a landslide in favor of git
21:10
Yeah, but never got implemented for some reason...
(At least for Docs)
pce
pce
@ahmed hope you have success, if you want to try the gtk-webkit theory, before you compile a C GTK+ app (gtk.org/download/macos.php), you could try it with pyGtk at first; pastie.org/private/c6wyz5xegwpbi2dnkykrta and concentrate on the PHP-Webserver.
@MadaraUchiha I meant, they call online editor like that :) I'm all pro git.
Anonymous
@Gordon If I asked you to, can you spare me from this page for a day?
@phpNoOb what do you mean with spare? you mean block you?
Anonymous
Yep
21:15
I think he means ban him @Gordon
@phpNoOb from chat or from SO?
Anonymous
I don't need the distraction
Anonymous
nooooooooooo
Anonymous
from Chat only
@phpNoOb You know, you could just.. leave..
Anonymous
21:16
I can't resist @MadaraUchiha
Which is the recommended way (via .htaccess) to rewrite from /example/index.php to /example/ ?
@Gordon that's the only one I could find too. I have an implementation, I just don't want to release something if it already exists. :) cheers
@phpNoOb sure. how long do you want? one day or more?
@Baumr That's the default behavior.
I couldn't find a question that matched -- though there's a flood of similar ones here
@MadaraUchiha How so? It doesn't do it in my case -- duplicate content issue (since /index.php will also show up)
Anonymous
21:17
Study finishes, in 3 days. So, block me FROM CHAT ONLY for 3 days
@phpNoOb Before you ask him to do that make sure there's no other negative repercussions
Evening
Jo Chris
i.e. future bans won't be longer b/c you were already banned previously
@phpNoOb your will be done. banned for 72 hours
21:18
> This user has been temporarily suspended by a moderator and cannot chat for 2 days.
Hey Chris
@MikeB Ban durations are manually set each time
@MadaraUchiha Right but if another mod is going to punish him for some future indiscretion and decides to glance over his "rap sheet" it won't look good
user895378
thank goodness for tiny avatars.
@MadaraUchiha Any comments? Thanks
@Baumr Well, when you go to example.com, it would automatically assume you mean example.com/index.php (or html, it would look for both)
21:21
It would look at the DirectoryIndex directive (or, well, Apache would)
@MadaraUchiha Right, that's clear
Okay, I give up. I don't understand where the patch suggestions go to. I can see some, but compared to how many I already did submit, this does not look right.
Which is a space separated list of file names searched LTR
@Baumr You mean that if you get example.com/index.php it should move to example.com?
@MadaraUchiha For example, this doesn't work stackoverflow.com/questions/8609119/…
21:22
@hakre In the doc editor itself they are also displayed
well but I want to see when and how they go into source.
Yup:

"Which is the recommended way (via .htaccess) to rewrite from /example/index.php to /example/ ?"
I have the feeling that never happens ;)
Not sure why he accepted that incorrect answer, but this should do it:
@hakre Patches in the doc editor only get into source when if somebody takes a look at them
21:24
RewriteEngine On
RewriteRule ^index\.(html?|php)$ / [QSA,NC,R=301,L]
Try that
Right now, I already have this to add trailing slashes to everything:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]
@MadaraUchiha Bad news I'm afraid ;-)
@DaveRandom Doesn't work :|
@MadaraUchiha Thanks, but /index.php still stays as that instead of being /
Yeah, probably (haven't tested it whatsoever)
I know it doesn't, people who think it will work don't understand mod_rewrite ;-)
You know how you want to redirect something... well... what do you think that directive might be called... hmmm...
Redirect 301 /index.php /
No expensive regex or mind-melting flow control.
21:26
Right, but I'd have to do that manually for tons of pages..
@Baumr Well there's your question, why do you have tons of pages that needs that done in the first place?
@MadaraUchiha Because every directory has an /index.php file inside
@Baumr Smells like wrong structured app
@MadaraUchiha And while I link internally to "/" each time, the other may sneak up
So to avoid duplicate content, would want to redirect to one place
@Baumr Also, why do you care?
duplicate content? for SEO?
21:29
The problem you have with mod_rewrite is that by the time you hit the rewrite process, the DirectoryIndex has already been resolved, so you are going to end up with a redirect loop. Pretty much unavoidably.
@igorw kore held a talk about Monads. He might have something to salvage from his slides: stuff.qafoo.com/functional_programming_with_php.pdf
How so?

This is pretty standard:
index.php
/dir/index.php
/dir2/index.php
/dir3/index.php
@MadaraUchiha Yeah, and just have everything consistent
Redirect directive or REQUEST_URI validation in PHP are realistically your only two options, unless @rdlowrey has any bright ideas, but I'm pretty certain there's no more dynamic way around the issue at the Apache level.
@Baumr Well, 1) Google doesn't care. / vs /index.php is rather well-known throughout the web
user895378
@DaveRandom Sadly, I don't know much about Apache.
21:31
@rdlowrey Don't be sad about that
@rdlowrey I'm not sure "sadly" is the right word there
lol
@rdlowrey It's a badass helicopter
and 2) if you're real paranoid, you have <link rel="canonical">
user895378
@Gordon I prefer Comanche, personally.
hello guys!
21:32
@rdlowrey I like Blackhawks. They got stealth
anyone can tell me please how can I protect myself against php injection? :)
@MadaraUchiha Not necessarily true: seomoz.org/q/duplicate-content-index-php-issues
Actually @Baumr there might be a slightly ugly hack, one sec
@Alex You mean... SQL injection?
@MadaraUchiha Already set that
user895378
21:33
In my server I transparently 301 redirect any filenames in the "index list" to / by default (can be turned off).
@MadaraUchiha no i mean php injection
one second i'm asking the support
@Alex You may want to explain what PHP injection is first.
@rdlowrey How? Does that include .jpg and .png files? Or .pdf files?
@Gordon cool :)
@Alex just don't execute anything coming from the client :P
21:34
@PeeHaa埽 but the client might execute it
@Alex no the client might not
that's why it is the client and not the server
user895378
@Baumr No, say I tell my static file server that index files are defined by the array ['index.html', 'index.htm'] ... by default any request that arrives for mysite.com/somedir/index.htm would get a 301 response pointing to mysite.com/somedir/
@PeeHaa埽 but if the file's permission is set to execute then he can easily execute it on my server
no ?
user895378
It just depends on what filenames I configure as directory indexes.
@Alex how would he do that?
21:36
@rdlowrey Ah, cool, with what are you doing that?
user895378
@Baumr It's homemade code. A webserver I've been working on in my spare time.
@DaveRandom Go on :D
RewriteCond %{THE_REQUEST} ^\S+[ \t]+\S*?/index.php(?:?[^ \t]*)?[ \t]+HTTP/1.[01]$ [NC]
RewriteRule ^(.*?)index.php$ $1 [R=301,L,QSA]
@Baumr try that ^^
@DaveRandom Ah, so using mod rewrite for index.php and index.html stuff like is plastered all over various forums, is incorrect?
@DaveRandom go home drunk you're dave
21:38
I said it was ugly. Also totally untested
@DaveRandom "Internal Server Error" :P 500
So is this also incorrect use of mod_rewrite?

#RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]
@PeeHaa埽 simply ..www.yoursite.com/myweakscript.php?page=hisuploadedfile.jpg?cmd=remdir blabla
@Baumr Yeh you can't comment out RewriteEngine On if you want rewriting to work ;-)
21:39
(That's to add a trailing slash to all directories.)
user895378
This rewrite farce illustrates my belief that layering dynamic resource generation on top of a server built to handle static files is inherently stupid. They're not the same thing.
@DaveRandom For some reason it works! That's why I commented it out as "unnecessary code" -- should I put it back? :P
@rdlowrey true story
user895378
But apache does it that way and every other server just blindly follows suit.
@rdlowrey Interesting
21:41
@Baumr Even if it's enabled at the vhost level - and if it is you should find a server administrator who's not an idiot - I would leave it there for clarity
@Alex And what do you think what that does?
@DaveRandom It's on shared hosting, but thanks
RewriteRule (^|.*/)index.php $1/ [R,L]
@DaveRandom Also, I don't get the difference between !-f and !-d (I saw some people using only the former, and others with both) -- whcih should I use?
@Baumr In general, both
user895378
21:42
FYI .htaccess processing and rewrites are a recipe for ultra-slow site performance ...
@uınbɐɥs "Internal Server Error 500"
user895378
But if you're on shared hosting it probably doesn't matter that much :)
@rdlowrey So how do big sites do it? For example, look here facebook.com/about/timeline -- it goes to a page without the trailing-slash
depends what you are doing. Think of it like this: -f is is_file() and -d is is_dir() - if you combine them if basically does file_exists() and more often than not, the latter is what you want in a rewrite set
@Baumr FB runs on a highly customised stack, forget about how they do it, it's not relevant to someone on shared hosting.
I'm going for a smoke and then I shall actually try and make this work, I'm interested now.
21:46
@DaveRandom Hmmm, OK
@DaveRandom Haha, awesome :D
Please don't s/ping/star messages that helped you personally, but are not really that interesting for others
@PeeHaa埽 Was interesting to me :P
@DaveRandom Also, this is different, but seems interesting: stackoverflow.com/a/11813084/1779823
RewriteEngine On
RewriteCond %{REQUEST_URI} (.*)
RewriteRule (^|.*/)index.php %1/../ [R,L]
Works for me
@uınbɐɥs Nice! Same here - works!
@uınbɐɥs Why did you put only R and not R=301?
Baumr: a site like Facebook doesn't use redirect rules, they just parse all urls in code
And 301 is default for R
21:51
@Niels 302 is default
@Niels So why do some folk do [L,R=301]?
Oh my bad
@Baumr Use R=301
Makes sense, 302 is usually more appropriate
It's better to use "301: Moved Permanently" rather than "302: Found"
21:52
@uınbɐɥs Yup
@uınbɐɥs Actually, now 302 is just "Found" - but basically means: "All other reasons"
@uınbɐɥs Interesting approach and, frankly, eewwww, but nothing you do here is going to be nice, so good call I guess. The RewriteRule needs and end of subject assertion though or you'll also match /index.php/stuff or index.phpstuff. And I'd probably make the .* non-greedy.
It was practically changed because it usually just means 'look elsewhere and do not cache', without the implied added semantics of 303
@DaveRandom Ah, true, it does match everything.
So just add: $ after index.php?
Yeh, that should do it, index.php is always going to be at the end of the URI you want to match
@DaveRandom Damn, didn't work: "Internal Server Error 500"
21:55
Hello everyone !
@Baumr Really? :-X
@DaveRandom Yea :|
You should enable rewrite logging, find out what's going on
Baumr: enable RewriteLog while building rules to see what goes wrong why
If I did it right:
`RewriteRule (^|.*/)index.php$ %1/../ [R=301,L]`
21:57
Yeh that's what I meant. Try making the .* non-greedy (^|.*?/)index.php$
@Niels On it :)
Oh, and index\.php - I forgot to escape the dot.
and that ^^
@uınbɐɥs Cool
I do that a lot
21:58
Shouldnt matter in this case tho
What is "Log to a pipe:"?
@Baumr You aren't interested in it. Just log to a file
Every time I see monads or currying or the y combinator explained using examples in PHP I want to poke my eyes out.
So much boilerplate for so little gained.
@PeeHaa埽 lol
21:59
lol
@PeeHaa埽 :D
No, that was a step too far :-P
I have shared hosting, and put the log files: RewriteLog "/rewrite.log"`
I made the file at the root (so above /www/), but nothing gets written to it..
Moved it to /www/rewrite.log (and left the command as /rewrite.log) and still nothing
The server root, on shraed hosting is below /www/, correct? I can't go any lower via FTP
@Baumr That path is treated as absolute, remove the leading slash
@Niels How can you claim to be following webstandards and at the same time use html5? ;)
22:05
@DaveRandom Hmm, still nothing
I put the rewrite.log inside:
example.com/rewrite.log

But also a directory above that (inaccessible via URL)
And: RewriteLog "rewrite.log"
Also set: RewriteLogLevel 3
Apparently, it's gone in newer Apache?
5
A: How to enable loglevel debug on Apache2 server

sp00nDo note that on newer Apache versions the RewriteLog and RewriteLogLevel have been removed, and in fact will now trigger an error when trying to start Apache (at least on my XAMPP installation with Apache 2.4.2): AH00526: Syntax error on line xx of path/to/config/file.conf: Invalid command ...

Where do I find the log files?
LogLevel alert rewrite:trace3
mysql_ API won't allow you to run two distinct queries without reading the result in between... — eis 1 min ago
is this true? (can't try it myself)
@Baumr One minute, just playing with something
ehh ...
-1 Clearly some frameworks are more suited to MVC than others. Usually it's the ones that include models, view and controllers. — Rein Henrichs 3 mins ago
22:16
@tereško You're a stickler for that kind of misuse :p
I like this one waaay better though
I have worked with Zend Framework, CodeIgniter, and CakePHP. Of those CakePHP is the most strict. — Jason Holland 1 hour ago
@peehaa: what?
I had a quick glance on your linked website
It states that webstandards are important and right after that html5 is used. I always think that's funyy :)
Ah, and you're referring to html5 not being a standard?
22:21
didn't w3 recommend html5 as the proposed standard back in dec'12 ?
W3Cis a mess
RewriteCond %{THE_REQUEST} (?:/[^/]*)*/index\.php[?#\ ]
RewriteRule ^(.*?)index.php$ %{REQUEST_URI}/../ [L,R=301]
@Baumr ^^ that works for me.
That and the general "marketing nonsense" ;-)
Html5 is still draft officially I think
@Niels i remember it passed that state
22:22
I commonly think or say "Open the model" (referring to a specific file) but in the strictest sense mean open the file containing the logic that belongs at the model layer in context of the conversation
I dont care about what w3c calls it, I care about universal support
@kaᵠ It's a CR
@Niels Well you don't have either :P
When 99% of browser support something officially and identically, it's a standard in my book
Doesn't seem to work for me, I commented out all other htaccess stuff apart from:


RewriteEngine On
RewriteCond %{THE_REQUEST} (?:/[^/]*)*/index\.php[?#\ ]
RewriteRule ^(.*?)index.php$ %{REQUEST_URI}/../ [L,R=301]
500 again
@Niels That means the standard is pretty thin
22:24
@Baumr You need to get a look at the logs. Even just the regular error logs would do if you can't manage the rewrite logs.
W3 seems to have made its main purpose to standardize things 2+ years after it gained universal support
@DaveRandom Sure, which ones/where/how do I enable/setup? :P
There are honestly standards like the transition module which have been stuck without change in proposed recommendation state for over a year without activitiy
For gods sake, there's only 4 properties involved in that one, and all browsers except webkit support it without prefix
@Baumr Whatever is configured in httpd.conf as ErrorLog for your vhost (or the global one if you aren't using vhosts)
blah
my bitcoin miner is still down
22:27
If you're using shared hosting it's kinda difficult to guide you
mining pool
@DaveRandom Yeah, I'm on shared hosting, so no httpd.conf Apache config files
@ircmaxell slush?
? @ircmaxell how'd that happen? forgot to give him food and water? :P
22:27
@DaveRandom Looking at web host providers site now
@PeeHaa埽 CR=
@ircmaxell getwork is still up, it's just stratum that's down. although he's now taking 10% on getwork blocks but it's still more than nothing
@DaveRandom btw, not only is it a 500 error for /index.php pages, but any page
good work Dave
@DaveRandom yeah, but my miner defaults to stratum
22:29
@Baumr OK that probably means you have a syntax error in the htaccess, can you pastebin the whole file?
@ircmaxell I was working on a proxy that would work for stratum and getwork miners and prefer stratum/fallback to getwork, never got very far with it though
(fat lot of good that does you :-P)
@DaveRandom Thanks, you're right -- don't worry, I'll look for it myself :)
Found it, turned out to be:

RewriteLog "rewrite.log"
RewriteLogLevel 3
Yeh well you don't need the log if it works anyway, in fact you don't want it because it will make the performance even worse
I escaped the .php too:

RewriteEngine On
RewriteCond %{THE_REQUEST} (?:/[^/]*)*/index\.php[?#\ ]
RewriteRule ^(.*?)index\.php$ %{REQUEST_URI}/../ [L,R=301]
22:34
@DaveRandom Why? :D
because I forgot to escape a dot, again...
@DaveRandom ooooh, I thought I did something wrong by doing so :D
@DaveRandom lol
OK, well, this works
Thanks so much :)
@DaveRandom Do you want to put it on codereview.SE?
@uınbɐɥs You don't need to escape the dots in the translate pattern, only the match...
22:35
@DaveRandom oh, of course
oops
@Baumr Oh, is there an actual question somewhere? Sure I'll put an answer on there, there aren't enough explanations of why the "traditional approach" to mod_rewrite won't work for this and why it's often not what you want anyway
@DaveRandom There's a lot of questions on SO
mod_rewrite in general is always not what you want, it's a double clawed hammer, unfortunately the next best alternative with Apache is bashing the nail in with your forehead so you just have to kind of make do.
@DaveRandom Yeah, I mean, doing 301s manually isn't better either
@DaveRandom But I meant more to put it on codereview to see what other folks think and make it more bulletproof
Man, if there's one thing the koreans know how to do REALLY well, it's fried chicken!
22:39
@Baumr Oh yeh, go for it. It's a hacky solution so you are likely to get a lot of :-X responses
php.net/manual/en/mysqlinfo.api.choosing.php shows 'Development status' for ext/mysql as: 'Maintenance only' <-- is that still the case ?? docbug?
@kaᵠ it is
@DaveRandom :D :P
@PeeHaa埽 still maintained?
@DaveRandom Well, it's your work, so I was wondering if you want to do it
But if you don't want to, I'm on it :)
22:43
@kaᵠ Not really. But it is not officially deprecated yet
@Baumr cba to be honest, you go ahead
@PeeHaa埽 shouldn't the docs say.. something else there like 'Critical only' ?
@DaveRandom Haha, OK
@Baumr The basic idea behind it is that by using %{THE_REQUEST} you are looking at the actual URI request by the user before any file system mappings, alias, other rewrite rules etc were applied.
@kaᵠ Well I can see that when there is some really huge bug found in it they will still try to patch it
22:47
Which is necessary in order to avoid a redirect loop
@kaᵠ considering php5.3 and php5.4 are still supported
gotcha
36 hours is pretty fast
Thanks :)

I've included that into the question — feel free to edit it as you deem fit:
0
Q: Automatically redirect /index.php to directory or root with .htaccess

BaumrThe requirements: Work inside .htaccess (preferably via mod_rewrite) Redirect requests from /any/directory/index.php to /any/directory/ Make sure that /index.php-with-stupid-stuff-here doesn't get rewritten Add trailing slash to directories, /another/directory becomes /another/directory/ Also...

22:51
I love how random some of the results in google image searches are, some of them are just completely unrelated to what you searched for
@Baumr In retrospect I'm going to change the rewrite rule to just RewriteRule .* %{REQUEST_URI}/../ [L,R=301] - the RewriteCond is what's doing the work here, you don't need to inspect the URI in the rule.
Sure thing, feel free to edit the question, or add that as an answer :)

(Or I can do either, just let me know.)
gone on a hunt
found
fast one... searched for a new php/mysql question using ext/mysql
There is no more support for mysql_* functions, they are no longer maintained and are officially deprecated. You should update your code with PDO or MySQLi to ensure the functionality of your project in the future. — ka ᵠ 1 min ago

« first day (914 days earlier)      last day (4259 days later) »