Solved

Want to change bar.htm/?source=whatever to bar.htm (without trailing slash or query string)

Posted on 2003-11-26
3
201 Views
Last Modified: 2010-03-04
I've spent two hours trying to mess with mod rewrite stuff to no avail.

I think the title pretty much says it all, but to reiterate...

I stupidly set up some URLs (on partner sites, search engines, etc.) a while back that look like this:

http://smilezone.com/foo/bar.htm/?source=overture  and
http://www.smilezone.com/foo/bar.htm/?source=findwhat

I'd now like to have these queries redirected to, for the examples above, to
http://smilezone.com/foo/bar.htm

(with no trailing slash or query string)

Thanks in advance for your quick help on this, and happy early Thanksgiving!

Regards,
Adam

P.S. -- Please note that I'll be gone a couple of days for Thanksgiving; I'll return by Friday and will view comments at that time.  Thanks for your help and your patience :)
0
Comment
Question by:ThatAdamGuy
3 Comments
 
LVL 33

Accepted Solution

by:
shalomc earned 500 total points
ID: 9934082
Adam,
try this:

RewriteEngine  on
RewriteRule    ^foo/bar.htm(.*)$  http://smilezone.com/foo/bar.htm

BTW, an HTML file is tolerant of any additional data appended to it after a question mark (in a QUERY_STRING).
Apache will simply serve the bar.htm file, so you may not need the rewrite rule after all.





0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now