If the problem is very easy please forgive me, I use PHP not a few days now learn to use
I used the PHP framework of oauth2.0.
http://localhost/api/token.php address like this.
How to implement access with Http://localhost/api/token
I searched, but it may seem that my posture is not right (the keyword is wrong), Google can not search
Reply content:
If the problem is very easy please forgive me, I use PHP not a few days now learn to use
I used the PHP framework of oauth2.0.
http://localhost/api/token.php address like this.
How to implement access with Http://localhost/api/token
I searched, but it may seem that my posture is not right (the keyword is wrong), Google can not search
Upstairs said all right, but may landlord need a concise answer ...
Placed in the token
directory index.php
, you can use the http://localhost/api/token
accesshttp://localhost/api/token/index.php
Cut
Oh Sorry ...
That's a little bit more complicated.
Add two words at the end of the .htaccess
document
Rewriteengine on
Rewriterule ^ (api/token) token.php [L]
You'll be able to accept it through the root directory. token.php
api/token
The first sentence is probably not, because there .htaccess
may have been this sentence before.
Of course you may not have .htaccess
a file at the moment, so you can create one yourself.
You may also find that .htaccess
there is no effect, it is necessary to configure httpd.conf
the ...
This issue is within the jurisdiction of the HTTP server, regardless of the PHP framework.
Some of the ways to consider this are:
- HTTP rewrite technology to allow URLs that conform to specific regular expressions to be processed by a particular script (WordPress, for many programs, recommended)
- HTTP redirection, and rewrite almost
- Directly provide the
token
file soft connect to token.php
, and then configure the HTTP server to make the token
file even if no extension is also handled by the PHP interpreter (not recommended)
- Even make a
token/
directory, with the help of home page file is also a way
Specifically, you need to follow what your HTTP Server software is and then specifically query.
can be pseudo-static implementation
Just use pseudo-static on the line, the. PHP ignored
Many PHP frameworks support this, which is called URL routing
You can also rewrite all requests to a route, route assignment