I have a website in which there are two html pages and .htaccess
volk ββ@ Sivadra: ~ $ ls -a ~ / web / test.dev /. .. .directory .htaccess page1.html page2.html
.htaccess look like this
volk ββ@ Sivadra: ~ $ cat ~ / web / test.dev / .htaccess RewriteEngine On RewriteRule page1.html page2.html
But when I go to test.dev/page1.html the redirect does not occur . The command showing apache modules shows that the rewrite module is
volk ββ@ Sivadra: ~ $ apachectl -t -D DUMP_MODULES | grep -i "rewrite" rewrite_module (shared)
Even if you browse the directory with modules, the published link is shown
volk ββ@ Sivadra: ~ $ ls -Fal / etc / apache2 / mods-enabled / | grep -i "rewrite" lrwxrwxrwx 1 root root July 30 30 14:06 rewrite.load -> ../mods-available/rewrite.load
The content of the file referenced by this link
volk ββ@ Sivadra: ~ $ cat /etc/apache2/mods-available/rewrite.load LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
Even just in case I checked if this module exists
volk ββ@ Sivadra: ~ $ file /usr/lib/apache2/modules/mod_rewrite.so /usr/lib/apache2/modules/mod_rewrite.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID [sha1] = 69db4255e339924d7facba51f8429824109cd398, stripped
The virtual host file looks like this:
<VirtualHost *:80> ServerName test.dev ServerAlias www.test.dev DocumentRoot /home/volk/web/test.dev ServerAdmin webmaster@localhost <Directory "/home/volk/web/test.dev"> Require all granted Options +Indexes </Directory> </VirtualHost> Why not redirect?