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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.