Welcome to Geeklog, Anonymous Thursday, December 12 2024 @ 08:53 am EST

Geeklog Forums

.htaccess URL rewrites and trailing /


Status: offline

winnerdk

Forum User
Full Member
Registered: 04/24/05
Posts: 339
Location:Panama City, Republic of Panama
I was looking at the error log files today and noticed some users were getting 404 errors for URL's that I thought should have been working.

A long time ago I did the .htaccess hack for SEO reasons, for example;

RewriteRule ^corruption/$ /index.php?topic=corruption [NC,L]

But then I noticed today (by looking at the error logs) if the trailing / is not included, then the user gets the 404 error. So; this URL works;

http://www.panama-guide.com/corruption/

While this one does not;

http://www.panama-guide.com/corruption

My question - how can I make them both work?

Don
www.panama-guide.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Text Formatted Code
RewriteRule ^corruption /index.php?topic=corruption [NC,L]


Assuming you don't have any other URLs that start with "corruption".

bye, Dirk
 Quote

Status: offline

winnerdk

Forum User
Full Member
Registered: 04/24/05
Posts: 339
Location:Panama City, Republic of Panama
Nope, none. The only difference is the trailing backslash...

Don
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
So, did it work? It did for me ...

bye, Dirk
 Quote

Status: offline

winnerdk

Forum User
Full Member
Registered: 04/24/05
Posts: 339
Location:Panama City, Republic of Panama
Yeah, thanks, that did it. Now I have to make the same change for all of the rest of the topics and categories.

Don
www.panama-guide.com
 Quote

All times are EST. The time is now 08:53 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content