开发者

htaccess rewrite/modrewrite help!

I have the following url http://puppetweb.ca/play/jokes.php?c=Get Well Soon (Get Well Soon, can be any category name like Adult Jokes, Blah Blah, it will always be spaced t开发者_JAVA技巧hough so XXXX XXXX format) and I want to change it so it is like http://puppetweb.ca/play/Get-Well-Soon/ (or what ever the category name is)

I have

Options +FollowSymLinks
RewriteEngine on
RewriteRule http://puppetweb.ca/(.*)/$ /jokes.php?c=$1

But it doesn't seem to be working.


Rewriting http://puppetweb.ca/play/Get-Well-Soon/ to http://puppetweb.ca/play/jokes.php?c=Get Well Soon. Is that what you want? If so, add this rewrite rule:

RewriteEngine on
RewriteRule ^play/(.*)/$ /play/jokes.php?c=$1


Because your regex is looking for a trailing / at the end of the line. Try this...

RewriteRule http://puppetweb.ca/(.*)/?$ /jokes.php?c=$1
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜