Best way to cloak the ?page_id=XX part of the URL without breaking links

What would be the best way to hide the end of my 2.8 WordPress site’s URL? Not sure if there is a plugin or just something I can drop in my .htaccess, but I need to keep the links and the other $_GET variables working.

All of my pages are something like this:

Read More
www.example.com/?page_id=1815

-or-

www.example.com/?page_id=3345&foo=35

and would like them to look like:

www.example.com/

Would this even be possible to do without breaking the links?

Related posts

Leave a Reply

1 comment

  1. You’ll have to send the page_id and whatever other information that’s in the query string over to the server somehow. If you just send / every time, the server is only going to server the main index, as it doesn’t know anything about a page_id. The best you can do is use some javascript on the browser’s end and make every link get submitted via a POST request, with the post_id and the rest of the query string as part of the request body so nobody sees that stuff in the browser’s location bar.

    Another way you can do it is maybe put your entire site inside of an iframe hosted by the index (e.g. http://www.example.com/) then all the links only display inside this iframe. That way, the URL in the location bar always says http://www.example.com/.