0
我有以下文件夹结构的网站:URL重写影响页面内容
website >> magazine >> news
里面news
我的文件包括:
htaccess, updates.php, articles.php & article.php
所以我htaccess
样子:
Options -MultiViews
DirectoryIndex updates.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^updates updates.php
RewriteRule ^articles articles.php
RewriteRule ^updates/([\w-]+)/?$ updates.php?id=$1 [NC,L,QSA]
RewriteRule ^articles/([0-9]+)/?$ articles.php?currentpage=$1 [NC,L,QSA]
RewriteRule ^article/([0-9]+)/([\w-]+)/?$ article.php?id=$1&title=$2 [NC,L,QSA]
我有的问题是,当我访问website.uk/magazine/news/updates/1459967836
它显示了我的文章的结果ID 1460544406
。
的代码在我updates
页:
...
if(isset($_GET["id"])){$id = $_GET["id"];}else{
$id = "latest";
}
?>
<?php
if ($id == "latest"){$var = "ORDER BY added DESC LIMIT 1";}else{$var = "WHERE id = '$id'";}
?>
<?php
$posts_sql = "SELECT * FROM magazine_news_updates $var";
...
有谁知道为什么当我访问1459967836
我gewt所示的结果为1460544406
。
此外,当我访问website.uk/magazine/news/article-add-form.php
时,即使URL显示正确,我也会看到website.uk/magazine/news/articles
。有任何想法吗?