opendir and mod_rewrite problem...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ch1mp
Forum Newbie
Posts: 2
Joined: Mon Feb 15, 2010 12:12 pm

opendir and mod_rewrite problem...

Post by ch1mp »

hi, i'm getting a "no such file or directory error" on some code that was working to read a directory before i cleaned up the urls with mod_rewrite.

i'm using a server relative link to the directory like "/folder/subfolder/", however i think this is getting translated to "index.php?var1=folder&var2=subfolder" when opendir tries to do it's thing...

i don't want to lose the clean urls so how can i get around this?

thanks in advance,

tom.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: opendir and mod_rewrite problem...

Post by requinix »

Rather than try to explain the whole concept of how the user can't see what PHP does, and that mod_rewrite has absolutely nothing to do with PHP, I'll just ask you to post code.
ch1mp
Forum Newbie
Posts: 2
Joined: Mon Feb 15, 2010 12:12 pm

Re: opendir and mod_rewrite problem...

Post by ch1mp »

cheers for the reply, i had posted for help with apache as well to solve this and between your reply and another there i've realised the error.

very simple, as you say (somewhat more bluntly as your sig suggests ;) php does not access resources via http, i had changed all paths in my app to work with the rewrite rules i'm using and in so doing added a server relative path which relative to the php file looking for the directory was wrong.

thanks again, between your post and the apache forum post you got my going in the right direction.
Post Reply