Jump to content
PHP論壇人

IPS 4.5若用手机APP要再修改Nginx伪静态 [简体] (Apache伪静态)


Recommended Posts

IPS 4.5若用手机APP,则原先的Nginx伪静态不适用

因为要再添加api目录的伪静态

 

我还没找到Nginx伪静态如何添加api目录的伪静态写法

本论坛今日先改用Apache服务器

IPS 4.5 根目录的Apache伪静态 .htaccess

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

 

 

IPS 4.5 api目录的Apache伪静态 .htaccess

<IfModule mod_setenvif.c>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /api/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

 

 


最后,论坛后台的REST & OAuth选项要能打开,可以看到手机APP

mobile-app.png

Edited by Jack
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...