Phpblogurlrewrite; this post was last edited by u0000089324 from 2013-11-2922: 46: 22. I am a beginner in php and want to write a simple blog (mainly learning php, wordpress is not used ). The current problem is: the blog homepage (www.mysite.com) displays some information about all the blog posts (the first two sections of the title and content, and the php blog url rewrite;
This post was last edited by u0000089324 at 22:46:22, January 29 ,.
Dear colleagues, I am a beginner in php and want to write a simple blog (mainly learning php, but not using wordpress ). The current problems are:
The blog home page (http://www.mysite.com) shows some information about all the blog posts (the title, the first two sections of the content, tags, dates, etc.), you want to jump to the reading page of the article after clicking the title, or click the tag to jump to the page where all articles corresponding to the tag are displayed. But don't want to use http://www.mysite.com/blog.php in the url? Postid = 100 to redirect, hoping to implement urllike http://www.mysite.com/blog/100as wordpress does. (My idea is on the blog. php dynamically displays the corresponding information based on the clicked jump address. for example, you can set the article title to title and click to jump to the blog. php: obtain the article id 100, query the database, and click the tag to display the corresponding information ). Is this implemented by configuring the rewrite rules of the server? Or are php programs used for parsing like wordpress? Or others. Which method is more efficient and less troublesome? To solve this problem, I plan to use the smarty template engine to display the articles on the homepage:
{Foreach $ articles as $ article}
{$ Article ['posted _ time']}
{Foreach $ article ['tags'] as $ tag}
{/Foreach}
{$ Article ['title']}
{$ Article ['content']}
Read more
{/Foreach}
$ Aritlces is an array containing the information displayed in all articles. for example:
While (has_post ()){
$ Articles [] = array (
'Posted _ date' => $ posted_date,
'Tags' => array ($ tag1,... $ tagn ),
'Id' => $ post_id,
'Title' => $ title,
'Content' => $ content
);
}
(Here is just an example of the array type included in $ articles. of course the implementation code will not be like this)
Excuse me, can I implement what I want in this way?
If it can be implemented, please kindly advise! Thank you !!
Php url? Rewrite blog design url rewriting
Share: More
------ Solution --------------------
If you don't have to worry about it, rewrite.