Jump to content

don't redirect existing files


Lumio

Recommended Posts

Hello!

I hope someone remembers my post in PHP Help.

I tried to redirect a file to index.php.

Now I thought when I do this it works:

RewriteEngine On
RewriteRule ^(.*)$ index.php

But it redirects every file to my index.php. It doesn't matter if the file exists or not.

that's a problem!

I don't want to redirect every existing file. It takes too much resources when index.php takes every file.

Link to comment
https://forums.phpfreaks.com/topic/38277-dont-redirect-existing-files/
Share on other sites

now it doesn't redirect files that doesn't exist

I mean... I got a directory like that:

/
|---- index.php
|---- test.html
|--- web/
     |--- lumio/
          |---- index.html
          |---- img.jpg

So if I try to get www.myexample.com/index.html the realpath is www.myexample.com/index.php?file=/web/lumio/index.html

But if I try to get www.myexample.com/test.html it is /test.html and not /web/lumio/test.html

Also not if it exists.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.