Forum Moderators: phranque
The problem is that I'm trying to create nice URL for it without any query strings.
Example:
[download.example.net...] will redirect to d.php?file=test.txt
[download.example.net...] will redirect to d.php?file=test/foo.txt
I created a .htaccess file like this:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)$ d.php?file=$1
For some reason I can't understand, the d.php's 'file' argument is populated with 'd.php'. At least that's what happends on my local test server.
---
On my live site, I get a 500 error with the same .htaccess file. I did some testing and found some odd results.
RewriteRule ^(.+)$ d.php?file=$1 <- 500 error
RewriteRule ^([a-zA-Z0-9/_\-]+)$ d.php?file=$1 <- no error
RewriteRule ^([.a-zA-Z0-9/_\-]+)$ d.php?file=$1 <- 500 error
It appears that the period in the regular expression causes a 500 error on my live site.
[edited by: jdMorgan at 11:08 pm (utc) on Sep. 10, 2007]
[edit reason] example.net [/edit]
which meant that Request URI contained "/download.example.net/test/foo.txt" so the exclusion never triggered.
And it appears that the live server, running Apache 1.3, would throw a 500 error on the loop, but my local test server running Apache 2.0 seemed to detect the loop and exit it instead of throwing an error.
I've got it working now.
[edited by: jdMorgan at 11:09 pm (utc) on Sep. 10, 2007]
[edit reason] example.net [/edit]