Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: No response for URL with uppercase characters  (Read 2345 times)

Joost

  • Guest
No response for URL with uppercase characters
« on: November 25, 2007, 09:09:33 am »

I found out that sNews doesn't behave properly when urls with uppercase characters are used.
When a page like http://snewscms.com/SITEMAP/ exists, it is not found, neither is a 404 header returned.
When a page like http://snewscms.com/SITEMAP/ does not exist, there is, again, no 404 header returned.

Tested local and on several servers. Some return the frontpage, some return Content not found, but always a 200 header.
Logged

pwendel

  • Full Member
  • ***
  • Karma: 8
  • Posts: 106
    • sNews 1.6 in Danish
Re: No response for URL with uppercase characters
« Reply #1 on: November 25, 2007, 10:45:46 am »

hmm, never thought about that before... is this when adding something manually or? otherwise everything should be lowercase I suppose...

In any case I think .htaccess should be the first place to look, there is a "nocase" flag you can add to the pattern, since default sNews .htaccess matches [a-z0-9] only.

Try this:

Code: [Select]
</IfModule>
RewriteEngine On
#RewriteBase /sNews16
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1&nbsp;articlespage=$2 [L,NC]

Before changing I suppose you could just test using the pre-rewrite filereferences to see if this was really the cause :)


« Last Edit: November 25, 2007, 11:00:02 am by pwendel »
Logged
"Opportunity is missed by alot of people because it comes dressed in blue overalls and looks like hard work" -- Thomas Edison (1847-1931)

Joost

  • Guest
Re: No response for URL with uppercase characters
« Reply #2 on: November 25, 2007, 11:50:46 am »

@pwendel

That might be something to look into, when I can make the time. I discovered this while testing a new mod. I like to finish that first. But I made a trip to other sNew sites and my findings are that most of them have problems returning header responses or showing the /404/ page.

It seems that mods can easily brake the standard sNews behaviour. Maybe reordering function center is needed. I'll put it on my "to do" list. :)
Logged