Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoid "?" in URL...

Status
Not open for further replies.

venim

Technical User
Jul 19, 2004
14
BE
Hello,

I was wondering if there is a way to turn a page URL like


into something without a question mark...

How would you do that?

Thanks for your time!
 
Interesting question - however, what do you mean by that?
Are you looking for a way to POST variables rather than using GET *querystring)?
Or do you just want to cut off the quesrystring?
Please elaborate.
 
What I mean is...
Is there like a realy good way to post a page like I mentioned in a search engine, because I read that many engines choke on the "?" in a URL.

the page.php?id=123 is a page which uses the "id" to build up the rest of the web page.
 
how about if the $_GET['id'] isn't set, add a default one to the page ?

if(!isset($_GET['id']))
{
$id=123;
}

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
You will have to send data via HTTP POST method instead of GET.

By doing so, $id will not be a part of URL (so is "?").

However you have to access $id in your code by $_POST["id"].

--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
because I read that many engines choke on the "?" in a URL
Hmmm, where are you reading this? Maybe the sources are out of date - my experience is that the current crop of search engines are more than happy handling such standards compliant urls.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
If you are running on Linux and have access to .htaccess have a look at Rewrite rules, this would allow you to have internally redirected to page.php?id=123

Also it's not neccessarily a good idea to have a parameter of id (the Google guidelines used to say 'id' should be avoided).

HTH

John K Mitchell
 
...the Google guidelines used to say 'id' should be avoided...
And doctors used to say smoking was good for you... your point?

Just because google used to say something (and now no longer does) - that does not mean that it will be true for ever and ever and ever.

That's 2 seperate incidents of FUD in the same post. Unbelievable. Learn to cite - and check the dates of some of these documents you are referring to. It'll save you this embarassment in the future.

Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
google said:
Don't use "&id=" as a parameter in your URLs, as we don't include these pages in our index.
I totally apologise -- you are correct. I hadn't done a specific search for 'id' but had read it manually... and obviously skipped it or just ignored it.

Please feel free to RF as appropriate.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top