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

  • SEARCH
  • Home
  • 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 8901449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:21:29+00:00 2026-06-15T01:21:29+00:00

I’ve attempted answers from about 10 existing SO questions to no avail. Using Salman

  • 0

I’ve attempted answers from about 10 existing SO questions to no avail. Using Salman A’s answer in Rewrite rule that removes query string from URL and redirect, I created the following .htaccess file:

Options +FollowSymLinks
RewriteBase /
RewriteEngine On
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^(.*) /$1? [R,L]

…with the goal being to take a url like this:

http://www.example.com/index.php?c=web

…and make it look like this:

http://www.example.com/web

After following Salman A’s answer, the urls looked like:

http://www.example.com/?c=web

Then I messed something up while trying to strip the “?c=” part — unfortunately I don’t know exactly what I messed up — and then I deleted the .htaccess file because I didn’t want to mess anything else up. Now, even without the .htaccess file, some of the url’s — notably, the three url’s I clicked while testing Salman A’s answer — still look like:

http://www.example.com/?c=web 

…even though I deleted the .htaccess file. Three questions: 1) why are the changes persisting despite deleting the .htaccess file; 2) is that anything I need to worry about; and, 3) how do I modify the .htaccess file to get all the urls to look like:

http://www.example.com/web

UPDATE: this is what I was worried about http://getluky.net/2010/12/14/301-redirects-cannot-be-undon/. If I botch a 301 redirect and new visitors go to the site, are they stuck with the botch? Is there a way to un-cache this?

  • 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-15T01:21:30+00:00Added an answer on June 15, 2026 at 1:21 am

    When you say “take a url like this and make it look like this”, do you mean make it look that way to the server or make it look that way to the browser (two completely different things). See the top part of this answer for some clarification.

    The answer that you’ve implemented makes the server see the request without the query string. After the URI /index.php?c=web makes its way through the URL/file mapping pipeline, mod_rewrite churns out: /index.php, removing the query string ?c=web and finally the web server takes /index.php and serves it (sans query string). Of course, while all of this is happening, the browser, which knows nothing of all this mod_rewrite magic flying around, still displays the same URL that it was told to display, http://www.example.com/index.php?c=web, and since it’s never told otherwise, that’s the URL you still see.

    If you want to change the URL that the browser sees, then you need to externally redirect the browser to the new URL. You can use something like this:

    RewriteEngine On
    RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ /(index\.php)?\?c=([^&\ ]+)
    RewriteRule ^ /%3? [L,R]
    

    So when your browser requests http://www.example.com/index.php?c=web, this rule will match against the query string, and redirect the browser to the result, /web, thus changing the URL in the URL address bar of the browser. The browser now sees this new URL, makes a brand new request to the server for this new URL. You’re probably going to want to change that back to what it originally was, because I’m guessing you really don’t have a directory or file at /web. So you do this:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?c=$1 [L]
    

    This makes it so the server sees /index.php?c=web when someone requests /web.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I am reading a book about Javascript and jQuery and using one of the
I am using jsonparser to parse data and images obtained from json response. When
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I

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.