LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-16-2009, 07:16 PM   #1
snucky
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Rep: Reputation: 0
complicated (correct) RewriteRules result in 404


I am trying to install a running site (Apache 2.2) on a different host (Apache 1.3). Both have mod_rewrite installed and i don't have any problems with simplistic rules. Once I am trying to access the sophisticated rules, I get a 404 error!

Also what previously worked as [\w-_\+] now results in 500 and I had to change it to [\w\-_\+] (note: backslash masks - now)

Here is the simplified .htaccess:
Code:
RewriteEngine On
RewriteBase /

# -------------- this rule declared WAR on me!
RewriteRule ^brands/[\w\-_\+]+/(\d+)/?$ /?go=brand_landing&brand_id=$1

# -------------- simple pages work!
RewriteRule ^(home|customer_service|terms)/?$ /?go=$1
 
Old 06-16-2009, 09:27 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
apache 1 and 2 ARE VERY DIFFERENT animals . and what would work on 1.3 dose NOT work on 2

and what worked on 2.2 WILL NOT work correctly on 1.3
you will need to rewrite that code for apache 1.3
SEE: http://httpd.apache.org/docs/1.3/
 
Old 06-17-2009, 08:14 AM   #3
snucky
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
Mhm, I guess that makes sense. I've been trying to get my act together though and just won't get it to work. What would the correct syntax be for the above example?
Thanks!
 
Old 06-17-2009, 05:42 PM   #4
snucky
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
It was the \d and \w etc. You have to define a range! [0-9], [a-zA-Z] respectively.

Thanks everybody!
 
  


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
Correct syntax to pipe to gpg and then mail the result... curtisa Linux - Newbie 1 11-14-2008 01:51 PM
Can't figure out Apache VirtualHosts + Tomcat + ReverseProxy + RewriteRules rave8151 Linux - Server 3 07-16-2008 11:15 AM
404 not found? jabos Mandriva 6 06-21-2007 11:48 AM
Apache RewriteRules? pk21 Linux - General 2 12-17-2003 07:43 AM
An Interesting and different 404 Asificare General 1 07-15-2003 09:29 PM

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

All times are GMT -5. The time now is 12:48 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