Problems with rewrite rules in htaccess

BelgianITGuy
BelgianITGuy used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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]
BelgianITGuyIT Manager

Author

Commented:
Hi Chris,

that was absolutely correct! Thanks a lot, you've saved me a lot of time.
BelgianITGuyIT Manager

Author

Commented:
Thanks a lot for the fast (and correct) response.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial