homepage Welcome to WebmasterWorld Guest from 54.196.63.93
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Simple rewrite rule stopped working on HostGator
Simple rewrite rule stopped working on HostGator
parorrey

5+ Year Member



 
Msg#: 3471466 posted 3:42 am on Oct 8, 2007 (gmt 0)

Hi,

this simple
^(portfolio/clients/[a-z-0-9]+)/$
rule has stopped working and showing 500 Internal Server Error on HostGator Server. Its working fine on other servers though.

Can somebody help?

 

parorrey

5+ Year Member



 
Msg#: 3471466 posted 5:02 am on Oct 8, 2007 (gmt 0)

following is the comeplte error message in error log.

/public_html/.htaccess: RewriteRule: cannot compile regular expression '^(portfolio/clients/[a-z-0-9]+)/$'\n

any ideas what's causing this?

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3471466 posted 1:11 pm on Oct 8, 2007 (gmt 0)

Probably a change in the regular-expressions library of the server operating system -- due to an OS change or upgrade.

The hyphen plays two roles within character alternation [groups]. It can represent either a literal hyphen or a "range indicator" (as in "a-z"). The interpretation of the hyphen, if ambiguous, can vary among regular-expressions processing libraries. So, it's best to avoid ambiguity, and where it might exist, to escape the hyphen so as to disambiguate it:

If you wish to match hyphens in your pattern:

^(portfolio/clients/[a-z0-[b]9\-][/b]+)/$

If you wish to match only letters and numbers:

^(portfolio/clients/[a-z0-9]+)/$

Jim

parorrey

5+ Year Member



 
Msg#: 3471466 posted 4:04 am on Oct 9, 2007 (gmt 0)

Thank you Jim. escaping the - did the trick.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved