I am beginner in .htaccess file configuration.I use xampp technology and I test my project in localhost. In my project when i type localhost in url , url should rewrite to localhost/test/test1 but address bar should not change. in htdocs folder I created sub directory (test) and another sub directory (test1) inside (test). I created one .htaccess file on htdocs and one another on (test) directory.
.htaccess on htdocs folder:
Options -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} . [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^test(.*)$ test/$1 [N]
.htaccess on test folder:
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} . [OR]
RewriteCond %{REQUEST_FILENAME} -f
#RewriteRule ^ - [L]
RewriteRule ^(.*)$ test1/$1 [L]
in test 1 i have index.php file:
<?php
echo "we are in test/test1 directory!!!";
When I type localhost in url I got this error:
Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500 localhost Apache/2.4.39 (Win64) OpenSSL/1.1.1b PHP/7.3.4