Click here to Skip to main content
11,789,512 members (56,331 online)
Rate this: bad
Please Sign up or sign in to vote.
Hello Guys. .
i am in trouble can any one help me i wan to use my php page like wordpress

example my link :
and i want my link like

anyone help me pls i really need this code thank in advance
Posted 19-Jan-13 9:47am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This has nothing to do with masterpages or wordpress.
What you ask for is seo optimized url's. It is called url rewrite.
See this article for apache mod_rewrite:[^], and IIS url rewrite:[^]
hasam53 at 19-Jan-13 16:17pm
Bro i didnt Get it Can you tell me with propre code :(
Zoltán Zörgő at 19-Jan-13 16:27pm
I doubt you have read the articles I have linked. There you have all. But here is an other, maybe you should start here:
The key: you have t set up a rewrite rule in the web server, and direct all calls to a single entry. That one will be the router. You have to make your code to use this approach. I can't give you more code than in the article above, since there you have the basic implementation - more would be too much. But if you want you can consult the wordpress engine source too:
hasam53 at 20-Jan-13 8:50am
bro i try it pretty URL but its not working :(
Zoltán Zörgő at 20-Jan-13 9:13am
What is not working? The url is working for sure. Aren't you behind a proxy blocking your access?
hasam53 at 20-Jan-13 9:18am
You Can See here

i make code and put that in .htaccess but still my url ugly :(
Zoltán Zörgő at 20-Jan-13 9:22am
First of all: what is your rewriterule?
hasam53 at 20-Jan-13 9:53am
Mean ? i am just puting
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^image([0-9]+)/[A-Z0-9_-]+\.html$ /test.php?id=$1 [NC,L]
Zoltán Zörgő at 20-Jan-13 11:54am
I am sure this rule is not what you want. What is the pretty url you want to redirect?
/image/1 to /test.php?id=1?
Than you would need: RewriteRule ^image/([0-9]+)$ /test.php?id=$1 [NC,L]
But this is a partial solution, you need a router entry point if you want every url to be redirected.
You can test your rules here:
hasam53 at 20-Jan-13 13:14pm
Yeah thanks Alot Bro coz of you i done it thanks aloT :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 954
1 Maciej Los 765
2 KrunalRohit 666
3 CPallini 606
4 Richard MacCutchan 420

Advertise | Privacy | Mobile
Web02 | 2.8.1509028.1 | Last Updated 19 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100