|
|
| Harris Kosmidhs 2006-11-29, 7:58 am |
| Hello. I have a problem with mod_rewrite.
I have a page article.php where I can call: article.php?id=1
Now I changed it using mod_rewrite so it's article/1
The problem is with the images and other stuff. I solved the problem
with images. Since I want my site to develop it locally I couldn't put
absolute paths. So in every link I use a $rel var which is "/" in the
server and put it to "" locally.
But the problem is when I access file from php. I used to have a
file_exists('pdf/file.pdf')
With mod_rewrite pdf/file.pdf can;t be found. Not can I use
.../pdf/file.pdf due to server limitations.
What's the trick here? How can I do it?
thanks
| |
| shimmyshack 2006-11-29, 7:58 am |
| mod_rewrite affects HTTP requests to the server, but here php is using
the file system, not HTTP, so mod_rewite isnt to blame.
Have you tried using _FILE_ and other such system variables that will
adjust to the server you are on, instead of having to set them yourself.
| |
| Harris Kosmidhs 2006-11-29, 7:58 am |
| shimmyshack wrote:
> mod_rewrite affects HTTP requests to the server, but here php is using
> the file system, not HTTP, so mod_rewite isnt to blame.
> Have you tried using _FILE_ and other such system variables that will
> adjust to the server you are on, instead of having to set them yourself.
>
can you please give me an example or URL? Can;t quite understand how to
use it.
| |
|
|
|
| "Harris Kosmidhs" <hkosmidi@remove.me.softnet.tuc.gr> wrote in message
news:ekjtko$f9a$1@volcano1.grnet.gr...
> The problem is with the images and other stuff. I solved the problem with images. Since
> I want my site to develop it locally I couldn't put absolute paths. So in every link I
> use a $rel var which is "/" in the server and put it to "" locally.
>
> But the problem is when I access file from php. I used to have a
> file_exists('pdf/file.pdf')
>
> With mod_rewrite pdf/file.pdf can;t be found. Not can I use ../pdf/file.pdf due to
> server limitations.
>
> What's the trick here? How can I do it?
>
> thanks
RewriteRule \.(css|jpe?g|gif|png|pdf)$ - [L]
This will effectively ignore these files. Assuming mod_rewrite is the actual problem.
-Lost
| |
|
| On Wed, 29 Nov 2006 14:13:40 +0200, Harris Kosmidhs <hkosmidi@remove.me.softnet.tuc.gr> wrote:
>Hello. I have a problem with mod_rewrite.
>
>I have a page article.php where I can call: article.php?id=1
>
>Now I changed it using mod_rewrite so it's article/1
>
>The problem is with the images and other stuff. I solved the problem
>with images. Since I want my site to develop it locally I couldn't put
>absolute paths. So in every link I use a $rel var which is "/" in the
>server and put it to "" locally.
>
>But the problem is when I access file from php. I used to have a
>file_exists('pdf/file.pdf')
>
>With mod_rewrite pdf/file.pdf can;t be found. Not can I use
>../pdf/file.pdf due to server limitations.
>
>What's the trick here? How can I do it?
>
>thanks
i had this exact problem solved by placing a base path in the header
<BASE href="http://www.YOURDOMAIN.com/yourFILE.php">
|
|
|
|