We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How to remove part of my url with htaccess?

Development and Programming

freaksauce's avatar
freaksauce
13 posts
15 years ago
freaksauce's avatar freaksauce

My typical url for my site is something like this:

http://www.guitarnoize.com/blog/comments/cry-baby-the-pedal-that-rocks-the-world-part-3

I want to completely remove /blog/comments/ as this is totally unnecessary for my blog. I’m a total htaccess n00b and currently have this:

RewriteCond %{HTTP_HOST} !^www\.guitarnoize\.com$ [NC]
RewriteRule ^(.*)$ http://www.guitarnoize.com/$1 [R=301,L]

RewriteCond $1 !^(images|js|themes|2007|labels|techniques|mp3|gn_system|css|swf|) [NC] 
RewriteRule ^(.*)$ /index.php?/$1 [L]

I removed some of the other directories and pages that are accepted by the RewriteCond too as it was quite long, if there is a better way to do this too like the opposite way around that would be great.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.