Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-21-2010, 02:50 AM SEO Friendly URL
Average Talker

Posts: 17
Name: Philips Tel
Trades: 0
hi..
how can i do to change this url:
http:www.example.com/index.php?category=article&id=12
to nicer URL by hiding the file extension or id, something like this:
http://www.example.com/article/article-title-goes-here/

I've found some solutions for that, that is by writing a regex in .httaccess file, but most of them still displayed id in URL like this:
http://www.example.com/article/12/ar...tle-goes-here/

is it possible if i want to hide the id and just display the title in URL, it might be something like this:
http://www.example.com/article/article-title-goes-here/

a lot of website uses such url, but i don't know exactly did those website perform the query based on title or id (id might be a primary_key), i think it is bad practice if the query based on title isn't it?

thx in advance!
philips is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-21-2010, 03:16 AM Re: SEO Friendly URL
Phunk Rabbit's Avatar
Ultra Talker

Posts: 255
Name: John Nerush
Location: Milton Keynes, UK
Trades: 0
It might be worth while looking at what blog systems these sites are using and looking at the source.

Example, if a site that is doing what you want is running wordpress, have a look at how wordpress does it.

Ive used a .htaccess file based on the wordpress seo friendly links for a while now and it works great but dosnt work quite how you want it to.

If your article titles are unique then you could just search from them in the url rather than id to begin with although im sure there is somthing wrong with that, that im missing.
__________________

Please login or register to view this content. Registration is FREE

Learn professional skills from professional people, from $6.50 a month.
Phunk Rabbit is offline
Reply With Quote
View Public Profile Visit Phunk Rabbit's homepage!
 
Old 06-21-2010, 03:34 AM Re: SEO Friendly URL
Average Talker

Posts: 17
Name: Philips Tel
Trades: 0
yeah,
perhaps it uses title as an unique instead of id, right?

according to your opinion does wordpres also use this way to its article..???

it think it does, am i wrong?
philips is offline
Reply With Quote
View Public Profile
 
Old 06-21-2010, 03:38 AM Re: SEO Friendly URL
Phunk Rabbit's Avatar
Ultra Talker

Posts: 255
Name: John Nerush
Location: Milton Keynes, UK
Trades: 0
I believe wordpress does allow this however im no wordpress expert, it would be worthwhile looking through the wordpress site.
__________________

Please login or register to view this content. Registration is FREE

Learn professional skills from professional people, from $6.50 a month.
Phunk Rabbit is offline
Reply With Quote
View Public Profile Visit Phunk Rabbit's homepage!
 
Old 06-21-2010, 03:49 AM Re: SEO Friendly URL
Average Talker

Posts: 17
Name: Philips Tel
Trades: 0

yeah, i think so too..
lol
philips is offline
Reply With Quote
View Public Profile
 
Old 06-21-2010, 04:21 AM Re: SEO Friendly URL
Extreme Talker

Posts: 193
Name: Adam Moseley
Trades: 0
settings - permalinks you can change it there
__________________

Please login or register to view this content. Registration is FREE
aadam is offline
Reply With Quote
View Public Profile
 
Old 06-22-2010, 05:50 AM Re: SEO Friendly URL
Average Talker

Posts: 17
Name: Philips Tel
Trades: 0
Quote:
Originally Posted by aadam View Post
settings - permalinks you can change it there
how can i do that ?
i'm not so expert in this stuff.
philips is offline
Reply With Quote
View Public Profile
 
Old 06-22-2010, 07:12 AM Re: SEO Friendly URL
Extreme Talker

Posts: 193
Name: Adam Moseley
Trades: 0
Quote:
Originally Posted by philips View Post
how can i do that ?
i'm not so expert in this stuff.
Read this, http://codex.wordpress.org/Using_Permalinks
__________________

Please login or register to view this content. Registration is FREE
aadam is offline
Reply With Quote
View Public Profile
 
Old 06-22-2010, 08:58 AM Re: SEO Friendly URL
Average Talker

Posts: 16
Trades: 0
.htaccess
RewriteEngine on
RewriteBase /
RewriteRule article/(.*)/$ index.php?category=article&linktitle=$1 [L]

And you write in you database a field name linktitle, and your select would be like this.
select * from articles where linktitle='".$_REQUEST['linktitle']."'";
__________________

Please login or register to view this content. Registration is FREE
- FileREX.com is an internet download website, from where you can download high-quality software.
perseadrian is offline
Reply With Quote
View Public Profile
 
Old 06-25-2010, 08:06 AM Re: SEO Friendly URL
Average Talker

Posts: 17
Name: Philips Tel
Trades: 0
@perseadrin:
Thank you, that's exactly what i want

@aadam;
i've read it, it was very amazin. good solution.

@all:
thank you very much for all the answers.
philips is offline
Reply With Quote
View Public Profile
 
Old 06-25-2010, 08:12 AM Re: SEO Friendly URL
Novice Talker

Posts: 11
Name: Jane Micheals
Trades: 0
Quote:
Originally Posted by Phunk Rabbit View Post
I believe wordpress does allow this however im no wordpress expert, it would be worthwhile looking through the wordpress site.
Yes wordpress does allow.
__________________

Please login or register to view this content. Registration is FREE
gcourtnz is offline
Reply With Quote
View Public Profile
 
Old 06-27-2010, 07:34 AM Re: SEO Friendly URL
Banned

Posts: 1
Name: robby342768
Trades: 0
Quote:
Originally Posted by Phunk Rabbit View Post
It might be worth while looking at what blog systems these sites are using and looking at the source.

Example, if a site that is doing what you want is running wordpress, have a look at how wordpress does it.

Ive used a .htaccess file based on the wordpress seo friendly links for a while now and it works great but dosnt work quite how you want it to.

If your article titles are unique then you could just search from them in the url rather than id to begin with although im sure there is somthing wrong with that, that im missing.
Right....
I think too.
robby342768 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to SEO Friendly URL
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.69932 seconds with 12 queries