Forum Moderators: coopster

Message Too Old, No Replies

$ GET problems

         

DaimonR

3:42 am on Feb 1, 2008 (gmt 0)

10+ Year Member



I've recently been made to work on someone else's script and make it work on our servers... the problem is this:

The current script has an includes directory with the pages listed in it, for example test.php
It references these includes using $_GET['page']
However, all links on the site are example.com/test

I'm not really sure how this was working, but it clearly isn't working on our site. Any ideas? Thanks in advance.

vincevincevince

3:51 am on Feb 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe that you've not copied across a hidden file named .htaccess. Copy that (possibly specified by name) and all should work again. Provided, of course, you have a proper Apache server rather than something by Microsoft

DaimonR

4:14 am on Feb 1, 2008 (gmt 0)

10+ Year Member



That's not going to be it. There was a .htaccess file and it copied over fine. :(

DaimonR

5:50 am on Feb 1, 2008 (gmt 0)

10+ Year Member



I suppose I should also point out that, as I expected, adding?page=test works fine, but somehow, the original script was getting it simply from example.com/test I'm really perplexed here and can't seem to find anything on any of the search engines or on php.net. Any help is much appreciated.

DaimonR

6:50 am on Feb 1, 2008 (gmt 0)

10+ Year Member



Ok, after much pain I think I've got myself started in the right direction, but if anyone has any words of wisdom it would be appreciated. I believe it has something to do with Apache's mod_rewrite. I'll keep looking but if someone has some experience here I'd love the help.

Since this has now clearly been shown NOT to be a php problem, admin may feel free to delete it if necessary. Thanks.

EDIT:
For anyone interested, however, the problem ended up being that the original files lacked a / prior to the file in the RewriteRule in (drumroll please) the .htaccess files. So thank you for making that post. It sent me looking in the write direction. Almost didn't as it had copied over... it was just wrong. Thanks again.

[edited by: DaimonR at 7:15 am (utc) on Feb. 1, 2008]

vincevincevince

7:52 am on Feb 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Initial / missing? Surprising that it worked on the previous host then. Figured it was almost certainly mod_rewrite rules in the .htaccess... glad it's sorted