Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8388849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:33:42+00:00 2026-06-09T18:33:42+00:00

Original url: example.com?file=gallery&d=doc I want: example.com/gallery.html My .htaccess: RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteRule

  • 0

Original url: example.com?file=gallery&d=doc
I want: example.com/gallery.html

My .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
RewriteRule ^([^/]*)\.html$ /?file=$1&d=doc [L] 

(removed d=doc from url because this not needed)

Now clean URL’s work but I want 301 redirect all old URL’s (?file=example&d=doc). Anyone can help me with .htaccces? Now page is availiable from example.com?file=gallery&d=doc and example.com/gallery.html but should be ONLY from example.com/gallery.html.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:33:43+00:00Added an answer on June 9, 2026 at 6:33 pm

    Try this :

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^www.med-pro.pl$
    RewriteRule ^(.*)$ http://med-pro.pl/$1 [R=301,L]
    
    RewriteRule ^([^/]*)\.html$ /?plik=$1&d=doc&r=0 [L]
    
    RewriteCond %{QUERY_STRING} ^plik=([^&]*)&d=doc$
    RewriteRule .* %1.html? [L,NC,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know how to make URL's rewrite, for example: www.example.com/index.php?id=1&cat=3 to www.example.com/1/3/ (or whatever).
I'm trying to user RewriteRule in my .htaccess file to redirect example.com/page to example.com/page.php
I am trying to use sideloading with imgur's api. $.get(http://api.imgur.com/2/upload.json?, { url: www.example.com/blah.jpg },function(response){
I've got a simple array working based off the url ie www.example.com/apple/ it places
i has a BufferedImage instance: (only a example) BufferedImage image = ImageIO.read(new URL(http://www.google.com/intl/en_ALL/images/srpr/logo1w.png)); now,i
I want to perform a redirection like this: http://www.example.com/something1 http://www.example.com/something2 http://www.example.com/something3 to http://www.example.com/something1.aspx http://www.example.com/folder/something2.pdf
I am wanting to rewrite a url like: http://my.project/mydomain.com/ANY_NUMBER_OF_CATEGORIES/designer/4/designer-name/page.html to this: http://my.projects/mydomain.com/ANY_NUMBER_OF_CATEGORIES/page.html?designer=4 I would
Example real site http://stackoverflow.com/ URL Masking http://masking.com/stackoverflow Question How to switch the URL masking
Let's say I have a URL: http://example.com/person/list This website will display a list of
I have my htaccess redirecting to a error404.php but I want that PHP file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.