Hi all,
Long time beneficiary, first time poster.
I've built a new Debian server for my PHP development, and migrated all my apps from my old SuSe box. On this new box, some RewriteRule directives are working, others are not. By "not working" I mean I get a 404. I can't see any rhyme or reason why.
Solution:
Turns out Multiviews was responsible for changing the URL before it hit the rewrite rules (see
Update) Adding "Options -Multiviews" fixed it.
Working:
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /alure
# Configuring Person properties
RewriteRule ^person/configure/$ index.php?c=person.configure [L]
# Viewing Person pages
RewriteRule ^person/([0-9]*)/$ index.php?c=person&person_id=$1 [L]
RewriteRule ^person/([0-9]*)/(.*)/$ index.php?c=person&person_id=$1&extra=$2 [L]
# Persons list
RewriteRule ^persons/$ index.php?c=persons [L]
Not working:
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /students
# Browsing
RewriteRule ^browse/$ browse.php?page=1 [L]
Both working and not working:
Code:
RewriteEngine on
RewriteBase /eventus
# These 3 work
RewriteRule ^month/([0-9]*)/([0-9]*)/(.*)/(.*)/ schedule.month.php?month=$1&year=$2&category=$3&location=$4 [L]
RewriteRule ^week/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)/(.*)/$ schedule.week.php?year=$1&month=$2&day=$3&category=$4&location=$5 [L]
RewriteRule ^day/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)/(.*)/$ schedule.day.php?year=$1&month=$2&day=$3&category=$4&location=$5 [L]
# This one doesn't
RewriteRule ^ical/(.*)/(.*)/ ical.php?category=$1&location=$2 [L]
I know mod_rewrite is enabled & working because, well, some .htaccess files are working appropriately. All these .htaccess files have the same access permissions. I know the destination files can be accessed because I can access them directly.
Any ideas?
Update
Turning on the RewriteLog, I saw one line that puzzles me:
Code:
applying pattern '^ical/(.*)/(.*)/' to uri 'ical.php/all/all/'
This appeared when I requested "ical/all/all" - why is ".php" being injected there?