Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can !
Moderator: General Moderators
Jammerious
Forum Commoner
Posts: 59 Joined: Sat Jun 27, 2009 11:30 am
Location: Slovenia (EU)
Post
by Jammerious » Sun Aug 09, 2009 10:35 am
Hi,
I was wondering, how on Earth does Apache do these rewrites, without them being set in apache2.conf file?
My example:
I open the browser and type:
http://server/foo/test
And it shows the test.php page. I want to prevent this.
Because, having:
Code: Select all
RewriteRule ^test/([0-9]{2})$ test.php?projectId=$1 [L]
And trying to visit:
http://server/foo/test/22
doesn't fall into the RewriteRule -> if I print_r($_GET) in test.php, nothing is seen, $_GET is empty.
Jammerious
Forum Commoner
Posts: 59 Joined: Sat Jun 27, 2009 11:30 am
Location: Slovenia (EU)
Post
by Jammerious » Sun Aug 09, 2009 2:08 pm
Hi,
thanks for pointing me in the right direction.
I tried adding:
Code: Select all
<Directory /var/www>
Options All
</Directory>
to apache2.conf, restarted it with no error and it still had multiview enabled, although in the docs it clearly says that this should make MultiView off.
http://httpd.apache.org/docs/2.2/mod/core.html#options
The correct way of doing this is to add the line:
to the .htaccess file.
Thanks =)
Jammerious
Forum Commoner
Posts: 59 Joined: Sat Jun 27, 2009 11:30 am
Location: Slovenia (EU)
Post
by Jammerious » Sun Aug 09, 2009 4:17 pm
One more thing..
All my relative URLs in the html document don't work with this enabled.
E.g.:
Code: Select all
<img src="images/icons/check_10.png"/>
Tries to locate the image at
http://server/test/images/icons/check_10.png
instead of
http://server/images/icons/check_10.png
What can I do besides having:
Code: Select all
<img src="../images/icons/check_10.png"/>
?
EDIT:
Oh OK, just realised this is more of a browser issue, $_SERVER['SCRIPT_FILENAME'] shows the correct route, so nothing to be done on the serverside?
Jammerious
Forum Commoner
Posts: 59 Joined: Sat Jun 27, 2009 11:30 am
Location: Slovenia (EU)
Post
by Jammerious » Mon Aug 10, 2009 4:14 pm
Well, using:
I solved this problem, hope there's nothing wrong with doing so