inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Aug 4, 2010 17:25:05 GMT -8
I read that thread that was in here.. and wow. -slaps forehead- It was a little much xD How do you even get urls like example.com/?action=something&person=you? And then, how would you use it for certain people? Like a member system?
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Aug 5, 2010 10:55:10 GMT -8
mod_rewrite Google it.
.htaccess: RewriteEngine On RewriteRule ^action\/(\w+)\/(\w+)$ index.php?action=$1&person=$2
example.com/action/something/you
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Aug 7, 2010 8:23:54 GMT -8
Question: erinuki-images.comlu.com/How would I get it to display certain sprites and it's type, in the URL? Like, I have sprites under the directory of diamond. This directory is within the "sprites" directory. I want the url to be something like: erinuki-images.comlu.com/index.php?type=diamond&id=000Thing is, they are .png's, so how would I factor that in? or would I have to include in the id: 000.png?
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Aug 10, 2010 20:14:58 GMT -8
In your example, index.php would need to include: if (array_key_exists('type', $_GET) && array_key_exists('id', $_GET) && is_numeric($_GET['id']) && is_dir('./sprites/' . str_replace('.', '', $_GET['diamond'])) && file_exists('./sprites/' . str_replace('.', '', $_GET['diamond']) . '/' . $_GET['id'] . '.png')) { header('Content-Type: image/png'); echo file_get_contents('./sprites/' . str_replace('.', '', $_GET['diamond']) . '/' . $_GET['id'] . '.png'); exit(); }
Or in .htaccess RewriteCond sprites/$1/$2.png -f RewriteRule ^index.php?type=(\w+)&id=(\d+)$ sprites/$1/$2.png
Although it may need to be %1 and %2 in RewriteCond. IDR.
However, you're doing the opposite of what you should be doing... It's much better for both SEO and server resources [and thus loading speeds] that you link directly to the image.
|
|