Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I use the following query string

?eve=MTkzODMwMjk0OQ==

to change the content of the node's body according to the value of the value of eve.

The full URL looks like this:

http://localhost/party/event.php?eve=MTkzODMwMjk0OQ== I would like to clean up the url to look like this instead:

http://localhost/party/event.php/eve/MTkzODMwMjk0OQ==

How can I do this with ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
799 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can even omit .php to make it more clean

Options +FollowSymLinks
RewriteEngine on
RewriteRule event/eve/(.*)/ event.php?eve=$1
RewriteRule event/eve/(.*) event.php?eve=$

Example URL

  http://localhost/party/event/eve/MTkzODMwMjk0OQ/ 

will transfer to

  http://localhost/party/event.php?eve=MTkzODMwMjk0OQ==

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...