如何获取状态代码307而不是200?我在ubuntu 18.04中使用apache2

如何获取状态代码307而不是200?我在ubuntu 18.04中使用apache2,apache,apache2,apache2.4,apache2.2,apache2-module,Apache,Apache2,Apache2.4,Apache2.2,Apache2 Module,下面是我的conf文件: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/kiran RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/index.html -f RewriteCond %{SCRIPT_FILENAME} !index.html RewriteRule ^.*$ /i

下面是我的conf文件:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/kiran

    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}/index.html -f
    RewriteCond %{SCRIPT_FILENAME} !index.html
    RewriteRule ^.*$ /index.html [R=307,L]
    ErrorDocument 307 /index.html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

我的要求是,当我点击页面时,所有内容都会显示307。您的客户端收到307,并被重定向到您从重写中排除的URL

# curl -iL localhost
HTTP/1.1 307 Temporary Redirect
Date: Sat, 28 Mar 2020 09:36:49 GMT
Server: Apache/2.4.29 (Ubuntu)
Location: http://localhost/index.html
Last-Modified: Fri, 27 Mar 2020 15:55:07 GMT
ETag: "239-5a1d8201d0033"
Accept-Ranges: bytes
Content-Length: 569
Content-Type: text/html

HTTP/1.1 200 OK
Date: Sat, 28 Mar 2020 09:36:49 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Fri, 27 Mar 2020 15:55:07 GMT
ETag: "239-5a1d8201d0033"
Accept-Ranges: bytes
Content-Length: 569
Vary: Accept-Encoding
Content-Type: text/html