Solved

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

Posted on 2003-11-26
3
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

738 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