I want to redirect an entire duplicate directory to the same files in the directory above the dup_folder.

Redirect Code in .htaccess:

Redirect 301 /dup_folder/ http://www.example.biz/

It redirects to:


But I want it to redirect to:


Is there something I can add to .htaccess to Rewrite the URL to how I want, or are the two above URLs seen as the exact same URL to a search engine?


Something else is at play here, that is causing


to be converted to


because out of the box, the use of Redirect 301 should not add that query string.

So I'd look at the configuration of your site, the httpd.conf or the configuration of the relevant apache Vhost directive, or indeed existing .htaccess files, to see if you can stop whatever custom redirect process is adding the query string there.

If you can't (find or change), then the following rewrite rule in a .htaccess file under /dup_folder/ (assuming you remove the existing Redirect 301 ) should remove the query string.

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/dup_folder/(.*)
RewriteRule .* /inspection11.htm? [R=301,L]

With the use of a trailing ? on the rewrite, it will clear off the query string that is being added by something else.

| improve this answer | |
  • It's been a while since I was messing with this. I'll look back into it tomorrow. The site that had this issue uses a CMS that performs it's own re-writes. Thanks for posting. – JMC Jun 1 '11 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.