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 1011509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:14:43+00:00 2026-05-16T09:14:43+00:00

so i read stuff about how apache’s mod_rewrite does the trick but it seems

  • 0

so i read stuff about how apache’s mod_rewrite does the trick but it seems to be too vague for beginners like me.

lets say i wanted to mask site.com/userpage.php into site.com/ or site.com/userpage

or even removing the get requests..

from site.com/userpage.php?query=yes into site.com/userpage.php or site.com/userpage

how can i do that by using htaccess or even other methods?

thanks guys

  • 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-05-16T09:14:43+00:00Added an answer on May 16, 2026 at 9:14 am

    First, remember to put this line in your .htaccess before any rewrites:

    RewriteEngine on
    

    If you want site.com/something to display site.com/something.php if it exists without changing the URL, do this:

    RewriteCond %{REQUEST_URI}.php -f
    RewriteRule .* %{REQUEST_URI}.php
    

    That will display a [file you requested].php if it exists while still showing the same URL you entered. If the php file doesn’t exist, it will still give you a 404 as it should. (That’s what the -f is for.)

    There is no way to hide the GET requests completely. You can get rid of the GET requests, but then they won’t be available to your script either and there’s no point. You can, however, make it look nicer. For example, if you want site.com/userpage/item/30 to display the content of site.com/userpage.php?item=30, you can do something like this:

    RewriteRule ^/userpage/item/(.*)$ userpage.php?item=$1
    

    You could also make it work with any GET value with a rule like this:

    RewriteRule ^/userpage/(.*)/(.*)$ userpage.php?$1=$2
    

    With that in effect, you could access site.com/userpage.php?query=yes with site.com/userpage/query/yes instead. That’s pretty much the best you can do; GET values have to come from the URL somehow, so if you want your inputs completely hidden you’ll have to use POST instead.

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

Sidebar

Related Questions

I know about RSA authentication, but for my purposes I want to use a
I have a scenario where one PHP process is writing a file about 3
I've read quite a few posts that are very similar to the question I'm
If you are talking about btrees, I wouldn't imagine that the additional overhead of
For an application I am building I have drawn 2 circles. One a bit
I have spent hours on a debugging problem only to have a more experienced
[Update - Sep 30, 2010] Since I studied a lot on this & related
Ok, it's been a while since I wrote in C++. and I've never done
I am familiar with the usage of Bonjour for advertising services on the local

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.