在php中重命名URL不起作用
我在写这个:在php中重命名URL不起作用,php,.htaccess,url-rewriting,Php,.htaccess,Url Rewriting,我在写这个: RewriteRule ^title$ articles.php?&=stop [QSA,L,N,S=15] RewriteCond %{QUERY_STRING} !stop RewriteRule articles.php? http://mysite.com/pages/title [r=301,L,nc] 为了从页面/标题?id_article=2重命名为页面/标题 但它不起作用。 有什么建议吗? 提前感谢您。如果您想使用PHP进行此操作,以下是脚本: <
RewriteRule ^title$ articles.php?&=stop [QSA,L,N,S=15]
RewriteCond %{QUERY_STRING} !stop
RewriteRule articles.php? http://mysite.com/pages/title [r=301,L,nc]
为了从页面/标题?id_article=2
重命名为页面/标题
但它不起作用。
有什么建议吗?
提前感谢您。如果您想使用PHP进行此操作,以下是脚本:
<?php
$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$url = explode('?', $url);
if(!empty($url[1]))
{
header("Location: http://".$url[0]);
}
?>
将页面/标题?id_article=2更改为页面/标题/2或页面/标题本身??页面/标题本身。。。有什么想法吗?我把标题搞错了。更好:使用HTACCESS重命名PHP URL。但谢谢你的回答。我打赌这对我在标题中的问题来说是个好问题。但对我真正的问题有什么想法吗?@duracell抱歉。。。不知道,我不知道