Welcome to WebmasterWorld Guest from 18.204.48.199

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Default Mod Rewrite?

.php files query.....

     
12:36 pm on Jan 18, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 18, 2004
posts:59
votes: 0


I have 2 apache servers one that rewrites the following

www.example.com/test.php/para1/para2 to test.php with the params sent to the script...

and one server that doesnt....

It must be something to do with mod_rewrite but I cant find out where its set up...

Any Ideas anyone?

Thanks

12:08 am on Jan 19, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
posts:1509
votes: 0


Yes, you will need to check the .htaccess files on the site that is working. If you cannot find the code there, then it has to be in the httpd.conf file.

Most FTP clients do not show 'hidden' files (like the .htaccess) by default, so you may need to set them to show in your preferences. If you have to manually enter the setting to show hidden files, I believe -AL the unix command.

Hope this helps.

Justin

12:30 am on Jan 19, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 18, 2004
posts:59
votes: 0


Yeah been all over, theres no .htaccess files in site or in the http,well in this case apache2.conf file, am stumped :(
12:34 am on Jan 19, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
posts:1509
votes: 0


Sorry, I did not read your URL correctly, the action is happening in your php script (test.php). $_SERVER['REQEUST_URI'] or something similar is grabbing the full request and creating the page from the information in the full URL. =)

Justin

12:31 pm on Jan 19, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 18, 2004
posts:59
votes: 0


Its the standard install of debian, for some reason all .php files get the rest of the url moved into variables..... where as the redhat doesnt...

so

debian /test.php/para1/para2 gives the file test.php with para1=para2

redhat /test.php/para1/para1 gives a 404.

Thanks

6:42 pm on Jan 19, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 9, 2005
posts:1509
votes: 0


This is really beyond my scope of knowledge, hopefully someone who is familiar with both systems can give you some more information, but appearantly they are treating the information after .php differently. Where one system is opening the page test.php, the other is attempting to access the full request in the directory tree.

You might be able to fix it with a simple rewrite:

RewriteEngine on
RewriteRule ^test\.php.+ /test.php [L]

The above says if the requested URL starts with test.php, followed by one or more characters, serve the information from test.php. There may need to be some adjusting, but it should get you close or give you an idea... I have not had time to test. (The server I usually test on recognizes the file, and not the full URL as the path.)

Don't know all the technical reasons why, maybe someone can give both of us some ideas about the technicalities.

Hope this helps.

Justin

7:39 pm on Jan 19, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 18, 2004
posts:59
votes: 0


Thanks for that.

I know I can do that, am just trying to work it all out, dont like being in the dark!