homepage Welcome to WebmasterWorld Guest from
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

how to remove folder name from url?
Client removed section name from cms now google links 404

 11:21 pm on Feb 17, 2011 (gmt 0)

Joomla site client removed the virtual folder "general" from the urls.

I can't even figure how she did that but it wasn't through htaccess.

Google linked her urls with /general/ in the url. They're 404'ing.

How can I re-write her site's links so that if someone asks for


it goes to the correct place which is


I've looked and looked but can't find this exact answer.

Thank you!

[edited by: jdMorgan at 4:53 am (utc) on Feb 18, 2011]
[edit reason] Switched to example,.com to avoid auto-linking [/edit]



 11:30 pm on Feb 17, 2011 (gmt 0)

those urls didn't print --


site / category / general / page

to be

site / category / page

thank you!


 11:39 pm on Feb 17, 2011 (gmt 0)

the reason those url's don't print is that you should use

example.com - that's what it is for.

... what have you tried so far?


 12:53 pm on Mar 1, 2011 (gmt 0)

thank you so much, my apologies for the delay.

I've tried

RewriteRule ^/?general([a-z/.]*)$ /$1 [R=301,L]

RewriteCond $1 !^general/
RewriteCond ^/(.*)$ /general/$1 [L]

RewriteRule ^general/(.*)$ /$1 [L]

I'm pretty much a newb at htaccess.
2 is a server error
1 and 3 just don't work


 1:53 pm on Mar 1, 2011 (gmt 0)

The redirects must be listed before the Joomla internal rewrite code.

The redirects must use RewriteRule syntax with the [R=301,L] flags.

RewriteRule ^(([^/]+/)*)general/([^.]+)\.html http://www.example.com/$1/$3.html [R=301,L]

Immediately after this code, place your canonical non-www to www redirects, again using RewriteRule syntax.

See also: [webmasterworld.com...]


 4:14 am on Mar 3, 2011 (gmt 0)

Fantastic! Thank you so much!

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