How to set a rewrite rule or PHP code for the following:
A User requests a page like /samy.john
. But this page does not exist, so he will get redirected to /index.html
and in the headline of index.html there will be a message that says Hello Samy which i开发者_如何学运维s taken from the first part of the URL he requested.
Any clues how to apply this?
I think your best bet to accomplish what you described is to have everything direct to an index.php file and then handle the redirecting yourself.
If you had everything fall to the index file you could then check the $_SERVER var for SCRIPT_URL or SCRIPT_URI, whatever meets your needs, and then say if that page didn't exist, but it meets your requirements for first_name.last_name you could then redirect, or include the content needed, so that the homepage would be displayed with hello first_name displayed.
Hope that helps.
精彩评论