General Community > Scripting Help

.htaccess question

(1/1)

Søren Bjerg:
Not really PHP as such, nor HTML/CSS... but here goes;

I would have searched Google for an answer, but I had no idea what to search for apart from "htaccess", which doesn't really narrow it down enough :-[.

So the question is how I'd setup a .htaccess file so ...

http://www.domain.tld/file.php/param=value

... would work like ...

http://www.domain.tld/file.php?param=value

... or something like that, so the URL wouldn't have a questionmark.

[Unknown]:
Actually, I'm told this works already.... (no change to .htaccess needed.)

You just have to set up your file.php file to parse $_SERVER['REQUEST_URI']... or, so I'm told.

-[Unknown]

Søren Bjerg:
That'd be sweet... thanks, I'll try playing around with it some.

EDIT: Seems to work nicely;


--- Code: ---$var = $_SERVER['REQUEST_URI'];
$var = substr(strrchr($thrid, "/"), 1);
--- End code ---

 8)

sensovision:
Søren Bjerg, what is the reason for changing URL? if you think current URL system isn't good enough check this topic it's proove that current system works perfectly and no extra tweaking is really necessary.

Søren Bjerg:
sensovision, some forums doesn't like questionmarks in the URL if the URL in question is a picture ;).

Don't care that much for spidering the entire forum as Google spiders what's important on my site very well as it is now (not that spidering was my reason for asking this question) 8).

Navigation

[0] Message Index

Go to full version