S
S
shiroyashik2021-07-11 21:15:38
Apache HTTP Server
shiroyashik, 2021-07-11 21:15:38

How to properly configure Apache?

When going to /home (and so on), an error about "cyclic redirection to the page" appears.
htaccess is configured correctly.

.htaccess

Options -Indexes

RewriteEngine on

# Redirect legacy pages
RewriteRule left.html index.php?redir=home [NC,L,QSA]
RewriteRule main.html index.php?redir=home [NC,L,QSA]
RewriteRule devicemac.html index.php?redir=devmac [NC,L,QSA]
RewriteRule ^(['_A-Za-z]+).html index.php?redir=$1 [NC,L,QSA]
RewriteRule ^(map[0-9]*+).php index.php?redir=map [NC,L,QSA]
RewriteRule find_ranges.php index.php?redir=ranges [NC,L,QSA]

# Rewrite for simple URIs
RewriteRule home$ index.php?page=home [NC,L,QSA]
RewriteRule rules$ index.php?page=rules [NC,L,QSA]
RewriteRule faq$ index.php?page=faq [NC,L,QSA]
RewriteRule apidoc$ index.php?page=apidoc [NC,L,QSA]
RewriteRule map$ index.php?page=map [NC,L,QSA]
RewriteRule find$ index.php?page=find [NC,L,QSA]
RewriteRule ranges$ index.php?page=ranges [NC,L,QSA]
RewriteRule devmac$ index.php?page=devmac [NC,L,QSA]
RewriteRule wpspin$ index.php?page=wpspin [NC,L,QSA]
RewriteRule upload$ index.php?page=upload [NC,L,QSA]
RewriteRule graph$ index.php?page=graph [NC,L,QSA]
RewriteRule stat$ index.php?page=stat [NC,L,QSA]
RewriteRule user$ index.php?page=user [NC,L,QSA]

# 404 page
ErrorDocument 404 /index.php?page=404

<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript application/json application/json-p
</ifModule>


Site config
<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot /var/www/wicat/public_html
  ErrorLog /var/www/wicat/error.log
  CustomLog /var/www/wicat/access.log combined
  <Directory /var/www/wicat/public_html>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>
</VirtualHost>


Ubuntu18.04.5 Apache2.4.29 PHP5.6

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question