使用 .htaccess 清理 URL?
如何简单地替换大写字母(我找到了, strtolower() )、符号和空格,而不这样做?
$url = str_replace( " ", "-", "$title");
$url1 = str_replace( "!", "", "$url");
$url2 = str_replace( "?", "", "$url1");
$url3 = str_replace( ",", "", "$url2");
$url4 = str_replace( ":", "", "$url3");
$url5 = str_replace( "'", "", "$url4");
$url6 = str_replace( ".", "", "$url5");
其次,我怎样才能创建这个URL, http://www. mysite.com/index.php?id=The-house-from-Up 通过 http://www.mysite.com/articles/The-house-from-Up 使用 .htaccess?目前我刚刚收到 500 内部服务器错误。
请任何帮助/指导! :)
How can I replace capital letters (I found it, strtolower() ), symbols and spaces simply, without doing it like this?
$url = str_replace( " ", "-", "$title");
$url1 = str_replace( "!", "", "$url");
$url2 = str_replace( "?", "", "$url1");
$url3 = str_replace( ",", "", "$url2");
$url4 = str_replace( ":", "", "$url3");
$url5 = str_replace( "'", "", "$url4");
$url6 = str_replace( ".", "", "$url5");
Secondly, how can I make this URL, http://www.mysite.com/index.php?id=The-house-from-Up be accessed through http://www.mysite.com/articles/The-house-from-Up using .htaccess? At the moment I just get a 500 internal server error.
Any help/guidance please! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)