Problems with rewrite rules in htaccess

I have a problem with a .htaccess file.

I have a domainname (test1234.com for this example), and if visitors go to http://www.test1234.com everything works fine.
If they go to http://www.test1234.com/files/blablabla/nonexistingsfile.pdf they are redirected to the index.php file, but the path is not changed. So any files used in index.php which are referenced by a relative path "./cssfiles/main.css" for example are not found. Images which are included with "./graphics/logos/mylogo.png" are not shown.

I've attached my htaccess file. Anyone have any idea how to get this right?
htaccess_for_expertsexchange.txt
BelgianITGuyAsked:
Who is Participating?
 
ChrisConnect With a Mentor Commented:
Sounds like, instead of a rewrite, what you actually want is an HTTP redirect. Change the final line to the following and see what happens.

RewriteRule ^(.*)$ /index.php [R=301,L]
0
 
BelgianITGuyAuthor Commented:
Hi Chris,

that was absolutely correct! Thanks a lot, you've saved me a lot of time.
0
 
BelgianITGuyAuthor Commented:
Thanks a lot for the fast (and correct) response.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.