PDA

View Full Version : PHP Wordpress style hyperlinking



swapnet
May 29th, 2008, 01:43 AM
hi there,

I wish to create dynamic hyperlinks in my website like in the wordpress site(s). Like instead of

mysite.com/users.php?id=alex, I know there is a way of doing
mysite.com/users/alex/


I went to http://coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/ but I was horrifically lost.

does anyone have any ideas?

djheru
May 29th, 2008, 02:47 AM
I know that this is usually done using mod_rewrite with apache. If your apache httpd.conf settings are set to AllowOverride Options (IIRC), then you can create a .htaccess file with a rewrite rule that rewrites your URL dynamically. Just google "url rewrite tools" and you will find sites that will let you enter your current (unattractive) url into a form and then it displays the rewrite rule that you need to put in the .htaccess file.

ahmednuaman
May 29th, 2008, 05:12 AM
Like this: http://codex.wordpress.org/Using_Permalinks#mod_rewrite:_.22Pretty_Permalinks .22 (It'll give you an understanding, and then you can move to: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html)

swapnet
May 31st, 2008, 02:15 PM
okay, I have the htaccess. I havve created the links (using query strings) .. now what do I do?

ahmednuaman
May 31st, 2008, 02:48 PM
Test!

matthewjumps
May 31st, 2008, 03:46 PM
upload the .htaccess file to your server, and then once its there, rename the file to htaccess (remove the '.') and then it should kick into effect