R
R
Roman Andreevich2019-05-08 12:23:37
Apache HTTP Server
Roman Andreevich, 2019-05-08 12:23:37

Why does apache2 always return 301?

Colleagues, good day, in continuation of the question Here , the question is:
the browser makes a get request to render the host.ru/contacts page - Apache returns 301 Moved Permanently and Location - /contacts/ - redirects, and the content is returned. The question is why?????
py sy: the engine is on the node, but the first request does not reach it!
Here is the apache config:

<VirtualHost *:80>

  ServerAdmin [email protected]
  ServerName tramite.localhost
  ServerAlias www.tramite.localhost

  #DocumentRoot /media/marey/projects/projects/tramite.online

  ProxyRequests off
  <Proxy *>
      Order deny,allow
      Allow from all
  </Proxy>
  <Location />
      ProxyPass  http://127.0.0.1:5263/
      ProxyPassReverse  http://127.0.0.1:5263/
  </Location>

  #RewriteEngine on
  #RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
  #RewriteRule . %1/&2 [R=301,L]

  #RewriteCond %{REQUEST_FILENAME} !d
  #RewriteCond %{REQUEST_URI} ^(.+)/$
  #RewriteRule ^(.+)/$ $1 [R=301,L]

  #RewriteCond %{SERVER_NAME} =tramite.online [OR]
  #RewriteCond %{SERVER_NAME} =www.tramite.online

</VirtualHost>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2019-05-08
@RidgeA

https://lmgtfy.com/?q=apache%20trailing%20slash

D
dodo512, 2019-05-08
@dodo512

Add to VirtualHost DirectorySlash Off

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question