homepage Welcome to WebmasterWorld Guest from 54.145.183.190
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Redirect a url only at a certain point
Marked

5+ Year Member



 
Msg#: 4492133 posted 11:56 pm on Sep 6, 2012 (gmt 0)

Hi guys,

I didn't really know what the title of this topic should be.. but here's what I'm trying to achieve:

I want to redirect domain.com/forums/ (note: ending slash) to domain.com/forums.

However I only want to redirect it when the first url there is accessed, because all the forums url's look like this: domain.com/forums/topic/324-title/ So it is important only to remove the slash when the /forums url is accessed.

I am also trying to do this using the .htaccess file.

Thanks in advance,
Mark.

 

g1smd

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



 
Msg#: 4492133 posted 12:07 am on Sep 7, 2012 (gmt 0)

Since /forums/ is a folder, the canonical URL is the one with a slash.

Don't fight the HTTP specifications.

Marked

5+ Year Member



 
Msg#: 4492133 posted 1:25 am on Sep 7, 2012 (gmt 0)

Its actually not a folder. The "forums" is a controller. Alternatively I could figure out how to get the controller to recognize both forums and forums/, right now the latter returns a 404, but I thought it would easier with htaccess.

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