LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-19-2013, 11:20 AM   #1
quasipickle
LQ Newbie
 
Registered: Jun 2013
Posts: 1

Rep: Reputation: Disabled
mod_rewrite rules stopped working after migration to Debian


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?

Last edited by quasipickle; 06-19-2013 at 03:38 PM. Reason: Adding update re: RewriteLog
 
Old 06-20-2013, 03:48 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
Hi quasipickle, welcome to LQ and thanks for providing us with the solution!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] udev rules suddenly stopped working in 9.10 ibwood Ubuntu 1 08-11-2010 10:31 AM
after new iptables rules proftpd stopped working arty Linux - Server 4 07-01-2009 01:18 AM
apache mod_rewrite rules - quick explaination sir-lancealot Linux - Server 1 05-02-2009 10:00 PM
Apache 2.0 | mod_rewrite | Can you group rules under one condition? ganz_friedrich Linux - Software 0 02-15-2006 02:46 PM
Debian sound stopped working HalfDiminished Debian 7 03-07-2005 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration