Advertisement
Guest User

Untitled

a guest
Sep 28th, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #Pi-hole | Redirect all webtraffic to index.html.
  2. # - Ensures redirect 301 code instead of 404 when a different directory is used (eg: www.myblockedsite.com/folder1/page.html)
  3. cat << _EOF_ > /var/www/.htaccess
  4. RewriteEngine On
  5. RewriteCond %{REQUEST_URI} !=/index.html
  6. RewriteRule ^ /index.html [R=301]
  7. _EOF_
  8.  
  9. #301
  10.  
  11. #Allow overrides and redirects
  12. sed -i "/AllowOverride/c\AllowOverride All" /etc/apache2/sites-enabled/000-default
  13.  
  14. #Enable apache2 rewrite engine
  15. a2enmod rewrite
  16.  
  17. #Restart service
  18. service apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement