开发者

Clean URL's with .htaccess?

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_re开发者_StackOverflow社区place( ",", "", "$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! :)


RewriteRule ^articles/(.*)$  index.php?id=$1 [NC,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜