Page 1 of 1

opendir and mod_rewrite problem...

Posted: Mon Feb 15, 2010 12:16 pm
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.

Re: opendir and mod_rewrite problem...

Posted: Mon Feb 15, 2010 10:48 pm
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.

Re: opendir and mod_rewrite problem...

Posted: Tue Feb 16, 2010 4:31 am
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.