Reply
Remove info from URL via htaccess
Old 03-01-2008, 06:23 PM Exclamation Remove info from URL via htaccess
Junior Talker

Posts: 4
This is probably dead simple, but I can't seem to find an article that addresses exactly what I need done. I already have an existing htaccess page with mod_rewrite rules applied.

I need an htaccess rule to turn this URL
http://www.sitename.com/archive/2008...Here/main_feed
into this URL
http://www.sitename.com/archive/2008...icle_Name_Here

I require a rewrite rule that will apply to all incoming traffic with the /main_feed at the end of it, regardless of URL.

Any help would be greatly appreciated. Thanks

Last edited by wedgin : 03-03-2008 at 10:09 PM.
wedgin is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 03-02-2008, 05:20 AM Re: Remove info from URL via htaccess
Bompa's Avatar
Extreme Talker

Posts: 171
Location: The Philippine Islands
Quote:
Originally Posted by wedgin View Post
This is probably dead simple, but I can't seem to find an article that addresses exactly what I need done. I already have an existing htaccess page with mod_rewrite rules applied.

I need an htaccess rule to turn this URL
http://www.sitename.com/archive/2008...Here/main_feed
into this URL
http://www.sitename.com/archive/2008...icle_Name_Here

Any help would be greatly appreciated. Thanks
It looks like you just want to clip 'main_feed' off the end?

RewriteCond %{REQUEST_URI} (.*)main_feed$
RewriteRule .* %1 [L]


That should do it. I did test it, but not all Apache installations are the
same, so yah never know.


Bompa
__________________
Get a Competitive Edge!
BLACKHAT BOOT CAMP

Last edited by Bompa : 03-02-2008 at 05:22 AM.
Bompa is offline
Reply With Quote
View Public Profile Visit Bompa's homepage!
 
Old 03-02-2008, 04:13 PM Re: Remove info from URL via htaccess
Junior Talker

Posts: 4
Thanks for the help. Unfortunately that definitely did not work. I loaded it up and it gave my whole site an internal 500 error. Is there a configuration that I might need to change?
wedgin is offline
Reply With Quote
View Public Profile
 
Old 03-03-2008, 01:06 AM Re: Remove info from URL via htaccess
Average Talker

Posts: 19
Name: Larry K
What I do on my site to simplify an address is go into htaccess and add a rule:

Code:
 Redirect /archive/2008...Here/main_feed http://www.sitename.com/archive/2008...icle_Name_Here
If you go to the address that you want to end up with, you end up at the site address you want to change. Great for shortening up a url full of page.php?foo=bar&stuff=things that cause errors in an html validator.

Might this meet your needs?
L a r r y is offline
Reply With Quote
View Public Profile
 
Old 03-03-2008, 09:43 AM Re: Remove info from URL via htaccess
Junior Talker

Posts: 4
Unfortunately Larry I require something that will cover all incoming URLs. My CMS keeps appending that to the URLs in my RSS feed, so I need it to be able to handle all URLs going forward and not single instances.
wedgin is offline
Reply With Quote
View Public Profile
 
Old 03-03-2008, 10:08 PM Re: Remove info from URL via htaccess
Junior Talker

Posts: 4
Anyone else have any insight on how to do this? I tried mucking around with RewriteRules and redirects and could not find a solution. It seems like such a simple task, but I can't seem to find any tutorials on doing exactly what I'm trying to do.
wedgin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Remove info from URL via htaccess
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13266 seconds with 13 queries