的.htaccess mod_rewrite的创造清洁的网址清洁、网址、htaccess、mod_rewrite

2023-09-02 09:51:28 作者:无爱无伤

我有一个数据驱动的网站传递的信息来确定下一个页面应该显示使用$ _GET参数。

I have a data driven site that passes information to determine what the next page should show using the $_GET parameter.

我想要的网址看起来更好,简单的结构。

I want the URL's to look nicer and be structured simply.

我一直在阅读有关mod_rewrite的,但至今未能实现它。

I have been reading about mod_rewrite but so far failed to implement it.

<?php $post = $_GET['ID']; ?>
<?php $loca = $_GET['loca']; ?>

这是从URL什么工作表中,我们想要的和帖子的ID。目前的网址是的index.php ID = 4和;失水=页

This is taken from the URL to work out what table we want and what post ID. The URL at the moment is index.php?ID=4&loca=Pages

我将如何做这项工作,如果它是代替。 /页/(这个名字的这个ID的柱后)

How would I make this work if it were instead. /pages/(the name column of the post of this ID).

推荐答案

有很多的的如何做到这一点的谷歌的例子。

There are a lot of examples of how to do this on google.

教程: http://wettone.com/$c$c/clean-urls

mod_rewrite的: http://httpd.apache.org/docs/current/ MOD / mod_rewrite.html

Mod_rewrite: http://httpd.apache.org/docs/current/mod/mod_rewrite.html