Forum Moderators: phranque

Message Too Old, No Replies

Make the end of url look pretty

         

greencode

12:02 pm on Nov 1, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



I'm using Wordpress for a site I'm building and there's section on their, with the use of hidden divs and tabs that adds the following on the end of a url. For example:

/?postTabs=0
/?postTabs=1
/?postTabs=2

I would like these to look like this:

/slideshow
/gallery
/map

Is there any way to do this with mod-rewrite and the htaccess file? I'd really appreciate some help with this.

jdMorgan

2:44 pm on Nov 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Link on your pages to the URLs that you want to use and that you want search engines to list. URLs are defined by links on HTML pages, and not by anything done in a server; This is easy enough to understand if you consider that if you link to a URL, then that URL exists and will be fetched by search engines and requested by users clicking on that link whether or not that URL resolves to an existing 'page' on any server.

Having defined your 'pretty URLs' by linking to them, use internal rewrites in .htaccess to 'connect' those URLs, when requested from your server, to the 'ugly' internal filepaths needed by WordPress.

You might want to look into the various 'SEF' plug-ins available for WP instead of modifying the script yourself; The advantage is that you won't have to re-modify the script every time a new WP security update is installed, and will therefore be less likely to join the legions of hacked un-updated-WP sites. Be forewarned however, that the mod_rewrite code supplied with WP is (or has been) terribly inefficient; It will likely need some tweaking to achieve good performance, so you might want to assess that (and post back here if necessary) if you go that route.

Jim