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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:04:48+00:00 2026-06-11T04:04:48+00:00

Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / # To externally

  • 0
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]

## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^ %{REQUEST_URI}.php [L]

the above works as far as removing .php from all of my urls. is it possible though to remove all parameters after the url if they exist? for example, rewrite site.com/index.php?id=24 to site.com/index

  • 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-11T04:04:50+00:00Added an answer on June 11, 2026 at 4:04 am

    Add a ? after the %1:

    # To externally redirect /dir/foo.php to /dir/foo
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
    RewriteRule ^ %1? [R,L,NC]
    # here ---------^
    

    When there is a ? in the target URI of a rewrite rule, the rule won’t append the query string unless there’s a QSA flag.

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

Sidebar

Related Questions

This is my code in the .htaccess: Options -Multiviews Options +FollowSymlinks RewriteEngine on RewriteRule
Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} ^http://agilerent.com$ [NC] RewriteRule ^(.*)$ http://www.agilerent.com/$1 [R=301,L] this is
I have this code in my .htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule
I have the following in my .htaccess Options +FollowSymLinks RewriteEngine on RewriteRule ^([a-zA-Z0-9\-]+)?$ index.php?url=$1/
I have the following rewrites in my .htaccess: Options +FollowSymLinks RewriteEngine On RewriteRule \.(css|jpe?g|gif|png)$
i have used the following code in .htaccess Options +FollowSymlinks RewriteEngine On RewriteBase /
I tried to enable htaccess. I changed: <Directory /var/www/abc.biz/> Options Indexes FollowSymLinks MultiViews AllowOverride
So I have the following .htaccess in my /var/www/site RewriteEngine on RewriteRule ^([^/]+)/?$ parser.php?id=$1
So pretty much said it but, using this in my .htaccess Options +FollowSymLinks -MultiViews
My main public_html directory has the following .htaccess rules: Options +FollowSymLinks IndexIgnore */* <IfModule

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.