Solved

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

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

Accepted Solution

by:
shalomc earned 500 total points
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

6 Experts available now in Live!

Get 1:1 Help Now