Reputation: 197
I want to map every URL-request (which is not a file or directory) to testindex.html
My .htaccess contains this:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . testindex.html
But if i try
http://localhost/test/aaaaaaaa
then i get only a 404-Error.
Apache webserver is started and it exists a testindex.html in the test-project.
Upvotes: 1
Views: 31
Reputation: 19016
Your problem is the path
(because of RewriteBase
).
Assuming your htaccess is in test
folder, like testindex.html
.
Replace your current code by this one
RewriteEngine On
RewriteBase /test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . testindex.html [L]
Upvotes: 1