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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:17:08+00:00 2026-06-12T03:17:08+00:00

The current RewriteRule removes any query except query callback for any URL. # Remove

  • 0

The current RewriteRule removes any query except query callback for any URL.

# Remove question mark and parameters
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^?#\ ]*)\?[^\ ]*\ HTTP/ [NC]
# Query rewrite exceptions
##RewriteCond %{REQUEST_URI}?%{QUERY_STRING} !^/api.*?callback=.* #does not work
RewriteCond %{QUERY_STRING} !callback=
RewriteRule .*$ %{REQUEST_URI}? [R=301,L]

How to avoid query callback rewrite just from URL ^api\/?([^\/]*)$? Excepted result:

  • no rewrite for /api?callback=1, /api/user?callback=1, /api/user/2?callback=1
  • rewrite for /apis?callback=1, /user?callback=1, /api/user?foo=1 etc.
  • 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-12T03:17:09+00:00Added an answer on June 12, 2026 at 3:17 am

    To enable RewriteRule for index.php, need to add in query rewrite exceptions.

    This rules works fine and fixes this issue:

    # Remove question mark and parameters
    RewriteCond %{QUERY_STRING} .+
    # Query rewrite exceptions
    RewriteCond %{REQUEST_FILENAME} !index.php
    RewriteCond %{REQUEST_URI}?%{QUERY_STRING} !/api(/.*)?\?callback=.*
    RewriteRule .*$ %{REQUEST_URI}? [R=301,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here are my current rules: RewriteCond %{QUERY_STRING} ^to=(one|seventeen|thirty\+four) RewriteRule ^/folder/page.php$ http://www.site.com/folder/category/%1? [L] RewriteRule ^folder/category/(.+)\+(.+)$
I have this in my .htaccess : RewriteRule ^images/([^/\.]+)/(.+)$ themes/current/images/$1/$2 [NC] RewriteCond %{REQUEST_FILENAME} !-f
I would like to remove the query string from the URL using mod_rewrite (.htaccess),
The current RewriteRule failed on /apis (must return index.php?url=apis) RewriteRule ^api\/?([^\/]*)$ index.php?api&url=$1 [QSA,L] RewriteRule
This is our current rewrite: RewriteRule ^share/([A-z0-9]+)[/{0,1}]?/([A-z0-9]+)[/{0,1}]?$ /mods/share/video.php?video=$1&hash=$2 [L] Basically, if I visit: http://www.site.com/share/f7Hje-xxGf/fio2fh92fh9bfh
My current .htaccess file contains the following lines: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule
my current url is something like: http://something.somedomain.com/about_us/profile.php?tab1=about_us a more complicated on is: http://something.somedomain.com/exchange_hosting/feature/outlook_web_access.php?tab1=exchange_hosting&tab2=feature&tab3=outlook_web_access i
Current URL: /shop/?display=category&id=cloths Rewritten to: /shop/cloths With the following rule: RewriteRule ^shop/([^/\.]+)$ /shop/index.php?display=category&id=$1 [L]
my current url is categories_name.php?cname=at&t rewritten url like this. carriers/at&t this is htaccess url.
I have the url: http://primarydomain.com/sites/secondarydomain/?foo=bar What regex expression could I use to match the

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.