Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

different rewrite rules for different apache versions

Posted on 2006-11-29
3
Medium Priority
?
200 Views
Last Modified: 2010-03-04
i have the following rule:
RewriteRule ^Town-([a-z]).htm$ byLetterDisplay.php?mode=Town&letter=$1

this works fine when i upload my htaccess file to my browser which seems to be running a new version of apache.

when running this in easy php it doesnt work.

if i change the ^T to ^t it does but then the uploaded version doesnt work.

someone did mention something to me about how they handle these slightly differently.

can some one give me a work around so it works on both?
0
Comment
Question by:scm0sml
3 Comments
 

Author Comment

by:scm0sml
ID: 18039484
by 'handles these' i mean capitals.
0
 
LVL 27

Accepted Solution

by:
caterham_www earned 1200 total points
ID: 18041674
e.g. use a character class [Tt] or use the NC flag to mark the wohle RegEx case-intensive

RewriteRule ^[tT]own-([a-z])\.htm$ byLetterDisplay.php?mode=Town&letter=$1 [L]
0
 
LVL 13

Assisted Solution

by:rhickmott
rhickmott earned 800 total points
ID: 18044085
caterham is correct try the [NC] flag first.

RewriteRule ^Town-([a-zA-Z]).htm$ byLetterDisplay.php?mode=Town&letter=$1 [NC,L]

You can remove the "L" part obviously if its not the last rule.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question