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.

Pages: [1] 2

Author Topic: [FIX] Trailing slash fix  (Read 17516 times)

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1716
    • http://www.snewscms.com
[FIX] Trailing slash fix
« on: April 26, 2006, 05:03:50 PM »

There was a minor bug with the .htaccess file:

Article would have been display with link:

www.domain.com/home/my-article/

And an error would have been displayed if the trailing slash was missing:

www.domain.com/home/my-article


Don't know if this was posted before but here it is.

This is the fixed .htaccess:


Code: [Select]



php_value session.use_trans_sid 0


RewriteEngine On
RewriteRule ^categories/$ index.php?category=categories [L,QSA]
RewriteRule ^contact/$ index.php?category=contact [L,QSA]
RewriteRule ^images/$ index.php?category=images [L,QSA]
RewriteRule ^login/$ index.php?category=login [L,QSA]
RewriteRule ^logout/$ index.php?category=logout [L,QSA]
RewriteRule ^new/$ index.php?category=new [L,QSA]
RewriteRule ^rss/$ index.php?category=rss [L,QSA]
RewriteRule ^archives/$ index.php?category=archives [L,QSA]
RewriteRule ^search/$ index.php?category=search [L,QSA]
RewriteRule ^unpublished/$ index.php?category=unpublished [L,QSA]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]


Logged

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[FIX] Trailing slash fix
« Reply #1 on: April 26, 2006, 09:45:50 PM »

<3
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[FIX] Trailing slash fix
« Reply #2 on: April 26, 2006, 09:55:49 PM »

what does that mean 'a'?
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[FIX] Trailing slash fix
« Reply #3 on: April 26, 2006, 10:17:56 PM »

it's a heart... ^_^ means love!
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1716
    • http://www.snewscms.com
[FIX] Trailing slash fix
« Reply #4 on: April 26, 2006, 10:18:25 PM »

Quote from: analyzerx
it's a heart... ^_^ means love!

Isn't that a ice cream?  ;D ;D ;D
Logged

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[FIX] Trailing slash fix
« Reply #5 on: April 26, 2006, 10:19:12 PM »

NOOO! :P it's a heart! :P
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[FIX] Trailing slash fix
« Reply #6 on: April 26, 2006, 10:22:42 PM »

 ;)

silly me..I see it now

so is this a broken heart?

<3  :P
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1716
    • http://www.snewscms.com
[FIX] Trailing slash fix
« Reply #7 on: April 26, 2006, 10:23:49 PM »

Quote from: bryn
;)

silly me..I see it now

so is this a broken heart?

<3  :P

No, It's a broken Ice cream...
Logged

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[FIX] Trailing slash fix
« Reply #8 on: April 26, 2006, 10:25:47 PM »

 ;D

yep..I asked for that one
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[FIX] Trailing slash fix
« Reply #9 on: April 26, 2006, 10:39:04 PM »

indeed you did! :P
hehe
broken hear is usually
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[FIX] Trailing slash fix
« Reply #10 on: April 26, 2006, 11:38:31 PM »

<3<--<<<

stupid cupid..stop picking on me!!!! ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[FIX] Trailing slash fix
« Reply #11 on: April 26, 2006, 11:39:17 PM »

lol :P
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

gomisan

  • Full Member
  • ***
  • Karma: 0
  • Posts: 194
    • http://fish-cam.net/
[FIX] Trailing slash fix
« Reply #12 on: April 27, 2006, 01:46:50 AM »

Thansk for the fix, worked a treat. (almost worked an icecream even!)


<3  = double cone?
<) = single cone?
Logged
Check out my sNews powered Tropical Fishtank site, live Fish-Cam !!

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[FIX] Trailing slash fix
« Reply #13 on: April 27, 2006, 09:55:56 AM »

I hate you too gnom! :P
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[FIX] Trailing slash fix
« Reply #14 on: April 27, 2006, 12:00:42 PM »

I do not see either an icecream cone, nor a heart... I see a butt ;)
Logged
"It's only dead fish that goes with the flow... "
Updated
Pages: [1] 2