Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[ask][.htaccess]rewrite rule trick?
18-07-2010, 08:46 PM,
Post: #1
[ask][.htaccess]rewrite rule trick?
disebabkan aku tatau nak buka kat mane topik ni, so aku buka disini GayFace

straight to the point la ye.
link asal mcm ni:
http://www.site.com/news.php?id=1
title die: hello world,

so aku nak rewrite url jadi mcm ni
http://www.site.com/news/1/hello-world/

ape nak karang kat .htaccess eh? GayFace
puas sudah menanam ubi, nenas juga dibeli orang, puas sudah aku berbakti, pengganas juga dipandang orang

Quote:A true warrior need blood on his sword; A true pirate never afraid to sail the red sea.
Reply
18-07-2010, 09:00 PM,
Post: #2
RE: [ask][.htaccess]rewrite rule trick?
RewriteEngine on
RewriteRule ^news/([^/\.]+)/?$ news.php?id=$1
[Image: GteM3.png]
Reply
18-07-2010, 09:05 PM,
Post: #3
RE: [ask][.htaccess]rewrite rule trick?
mcm mane plak dgn /title/ lepas $id tu
puas sudah menanam ubi, nenas juga dibeli orang, puas sudah aku berbakti, pengganas juga dipandang orang

Quote:A true warrior need blood on his sword; A true pirate never afraid to sail the red sea.
Reply
18-07-2010, 09:12 PM,
Post: #4
RE: [ask][.htaccess]rewrite rule trick?
lol

RewriteEngine on
RewriteRule ^news/([^/\.]+)/([^/]+)/?$ news.php?id=$1&nama=$2

cth
http://www.site.com/news/1/hello-world/
dia akan
http://www.site.com/news.php?id=1&nama=hello world
[Image: GteM3.png]
Reply
18-07-2010, 09:12 PM,
Post: #5
RE: [ask][.htaccess]rewrite rule trick?
ko takyah letak pun takpe.. sbb tu utk SEO sebenantye.. takyah letak kat news.php..
[Image: GteM3.png]
Reply
18-07-2010, 09:13 PM,
Post: #6
RE: [ask][.htaccess]rewrite rule trick?
ok tq suhz,
puas sudah menanam ubi, nenas juga dibeli orang, puas sudah aku berbakti, pengganas juga dipandang orang

Quote:A true warrior need blood on his sword; A true pirate never afraid to sail the red sea.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Masalah Berkenaan .htaccess taylorswift 2 497 14-09-2011, 01:16 AM
Last Post: taylorswift

Forum Jump: