Solved

different rewrite rules for different apache versions

Posted on 2006-11-29
3
195 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 300 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 200 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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Zipping many files freeze my whole server through php 5 68
PHP in Apache server 20 102
Problem to go to page 12 103
Does SSL have any bearing on connections via http on port 80? 3 53
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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