Welcome to WebmasterWorld Guest from 107.20.54.98

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

[PHP] How does the webserver know the directory?

     

GrodanBoll

2:51 pm on Mar 12, 2002 (gmt 0)

Inactive Member
Account Expired

 
 


Hi again, I keep stumble into trouble today. :(

I'm making a redirectpage for my place on the web.

It contains of a .htaccess-file


ErrorDocument 404 /processor2.php

So when people are trying to access a file that doesn't exist the will be redirected to processor2.php.
In the processor2.php i take the url apart and then include a file depending on the url.
For example:
[xxx.com...]
Then, when I take the url apart, I'll get one variables: game = 'cs' . I can the include the file gamestory.php and it will get the variables.

All this to get nice search-engine friendly pages.

It works fine until I get an '/' after the first variable (in this case 'cs'), then the server or PHP (?) are trying to access the file gamestory.php from the directory /cs/, which don't exist.
How can I get the server to collect the files from the main directory? Are there any header I can pass?

/grodan :)

3:15 pm on Mar 12, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 8, 2001
posts:926
votes: 0


Try include_once('/gamestory.php'); (or require etc).

Also take a look at mod_rewrite ... does all the things your doing in php, and lots more, definitely worth learning about.

GrodanBoll

7:03 am on Mar 15, 2002 (gmt 0)

Inactive Member
Account Expired

 
 


I solved this by using '.' instead of '/'. Like: www.example.com/dep1.news.12.html

/Grodan :)

10:42 am on Mar 15, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 8, 2001
posts:926
votes: 0


Grodan - I misunderstood your question first time round ... glad you fixed it.

GrodanBoll

10:45 am on Mar 15, 2002 (gmt 0)

Inactive Member
Account Expired

 
 


:)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members