Solved

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

Posted on 2003-11-26
3
202 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

816 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

11 Experts available now in Live!

Get 1:1 Help Now