1

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.

0

2 Answers 2

1

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]
Sign up to request clarification or add additional context in comments.

Comments

1

Try:

RewriteRule ^(.*)$ testindex.html [L]

1 Comment

Do you definitely have mod_rewrite installed?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.