Welcome to WebmasterWorld Guest from 54.146.246.4

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

how to change php permalinks?

     

ginx

8:35 am on Mar 7, 2010 (gmt 0)

5+ Year Member



Hello just got a script for my site <snip>
Now i want to change the php permalinks
e.g. If you click at acne link curently the link shows as http://www.example.com/showarticles.php?cat=100
i want it to show as http://www.example.com/acne/

Like wise first article in acne category here (Home >Acne>Whats The Real Cause Of Acne?) shows as http://www.example.com/showarticle.php?article=1770
I want it to show as http://www.example.com/acne/Whats-The-Real-Cause-Of-Acne?

So can someone please guide me how to change the permalinks to make them more SEO friendly.

Thanks :)

[edited by: dreamcatcher at 9:02 am (utc) on Mar 7, 2010]
[edit reason] Exemplified Urls. [/edit]

rocknbil

7:40 pm on Mar 7, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome aboard ginx,

If you click at acne link curently the link shows as http://www.example.com/showarticles.php?cat=100
i want it to show as http://www.example.com/acne/


Mod_rewrite Primer [webmasterworld.com]

Keep in mind many starting new with mod_rewrite get it backwards; you want to link to the SEO friendly link from your site,

http://www.example.com/acne/

The rewrite it to your PHP script.

ginx

7:49 pm on Mar 7, 2010 (gmt 0)

5+ Year Member



can u please elaborate further ? what and where to edit ?

rocknbil

8:45 pm on Mar 7, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Follow the link in the previous post. You would do this in the root level .htaccess file on most Linux servers.

mod_rewrite documentation [httpd.apache.org]

Hmm, seems like the Apache site is down today!

g1smd

9:05 pm on Mar 7, 2010 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Be sure to look at the right documents for Apache version 1.x or 2.x as appropriate.