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
SEO Friendly URLs - MOD REWRITE
Old 06-10-2005, 10:41 PM SEO Friendly URLs - MOD REWRITE
Novice Talker

Posts: 5
Trades: 0
Hi,

I have a website at http://www.b2b.rishta4u.com/ and it's with dinamyc pages built.

I am trying to rewrite this page http://www.b2b.rishta4u.com/cat_sell.php?cid=89 into something like:

http://www.b2b.rishta4u.com/cat_sell/cid/89.html or

http://www.b2b.rishta4u.com/cat_sell/cid/89/

but I could not resolve Apache;s MOD_REWRITE.

Also there's in PHP code cids that are called from MySQl db?

Do I need mod-rewrite only or both mod-rewrite and som php coding?

Can somebody help and show me a mod-rewrite for this page.

I appretiace any of your help.

Thank you.

dikimiki
dikimiki is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-11-2005, 02:54 AM
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Man, you should output links on your pages in a way of http://www.b2b.rishta4u.com/cat_sell/cid/89.html and then just add RewriteRule:
RewriteRule ^([^\/]+)\/([^\/]+)\/([0-9]+)\.html$ /$1.php?$2=$3
No changes of php script is needed if you already do something like
$sql = "select * from mytable where cid = {$_REQUEST['cid']}";
__________________

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

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 06-11-2005, 01:33 PM
Novice Talker

Posts: 5
Trades: 0
mtishetsky,

thank you very much,

Would you explain this better for me as I'm new in this MOD-Rewrite.

I have this in PHP script:

if(isset($_REQUEST["cid"]))
{
$cat_query=mysql_query("Select * from sbbleads_categories where sb_pid=" . $_REQUEST["cid"]);
$rs=mysql_num_rows($cat_query);

if(($rs<=0)||($_REQUEST["cid"]==0))
{
header("Location:"."selloffers.php?cid=".$_REQUEST["cid"]);
die();
}

}

Man, you should output links on your pages in a way of http://www.b2b.rishta4u.com/cat_sell/cid/89.html and then just add RewriteRule:
RewriteRule ^([^\/]+)\/([^\/]+)\/([0-9]+)\.html$ /$1.php?$2=$3
No changes of php script is needed if you already do something like
$sql = "select * from mytable where cid = {$_REQUEST['cid']}";

Should I add this in PHP code as link to pages :

http://www.b2b.rishta4u.com/cat_sell/cid/89.html

and then to mod rewrite?

I changed .htaccess per your instruction but a site loads and cannot be loaded fully!?!?!?

Thank you
dikimiki is offline
Reply With Quote
View Public Profile
 
Old 06-11-2005, 01:47 PM
HaRRo's Avatar
SEO Expert

Latest Blog Post:
The Large Hadron Collider
Posts: 522
Location: United Kingdom
Trades: 0
You could have like myoffers[CIDNUMBER].html

U will need something like that then htaccess pointing to the proper php file like he said
__________________

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

What are you waiting for? Easy $$$ anyone can make a fortune!
CLICK CLICK CLICK CLICK CLICK CLICK CLICK CLICK CLICK
HaRRo is offline
Reply With Quote
View Public Profile Visit HaRRo's homepage!
 
Old 06-11-2005, 01:50 PM
Novice Talker

Posts: 5
Trades: 0
Hi Again mtishetsky,

Here is the page link on index page - index.php:

<td><a href="http://www.b2b.rishta4u.com/cat_sell/cid/<? echo $cats["sb_id"];?>.html"><? echo $cats["sb_cat_name"]; ?></a>&nbsp;(<? echo $sbtotal; ?>)</td>

Thank you.
dikimiki is offline
Reply With Quote
View Public Profile
 
Old 06-11-2005, 01:52 PM
Novice Talker

Posts: 5
Trades: 0
Sorry this was change that I made;

This is the real page link:

<td><a href="cat_sell.php?cid=<? echo $cats["sb_id"];?>"><? echo $cats["sb_cat_name"]; ?></a>&nbsp;(<? echo $sbtotal; ?>)</td>

Thank you.
dikimiki is offline
Reply With Quote
View Public Profile
 
Old 06-11-2005, 02:13 PM
Novice Talker

Posts: 5
Trades: 0
I used as above:

<a href="http://www.b2b.rishta4u.com/cat_sell/cid/<? echo $cats["sb_id"];?>.html"><? echo $cats["sb_cat_name"]; ?></a>&nbsp;(<? echo $sbtotal; ?>)

to change page links for cat_sell.php?cid=89 and I have got this working when I click on a link on index.php but I got a page without pictures and on this page without pictures and with other links to other catalogue pages are with queries (MOD-REWRITE didn't follow the rest of the same links on a site).

Thank you.
dikimiki is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to SEO Friendly URLs - MOD REWRITE
 

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.70878 seconds with 12 queries