HTAccess重写动态页面网址

时间:2014-02-09 18:00:21

标签: php .htaccess url mod-rewrite rewrite

感谢您提前的帮助

基本上我已经创建了一个动态网址http://planet-dj-surrey.com/

我似乎无法找出htaccess文件的代码来重定向动态页面并使其更清晰。

例如我想要http://planet-dj-surrey.com/index.php?page=designprocess 改为

http://planet-dj-surrey.com/designprocess/

目前我有这个,但它似乎没有用,

RewriteEngine On
RewriteRule   ^/dropdownchoice/$   index.php?page=dropdownchoice  [NC]

提前致谢

2 个答案:

答案 0 :(得分:2)

这是一个简单的例子:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^post-(.*)-([0-9]+)\.html$ post.php?post_name=$1&post_id=$2 [L]

答案 1 :(得分:1)

你需要失去领先的斜杠:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ index.php?page=$1  [NC]
相关问题