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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:19:40+00:00 2026-06-15T18:19:40+00:00

How do I use the rewrite rule to replace the .php wth / For

  • 0

How do I use the rewrite rule to replace the .php wth /

For example:

search.php?k=background to search/?k=background

What I have so far is:

RewriteRule ^search/?k=([a-zA-Z0-9_-]+)$ search.php/?k=$1
  • 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-15T18:19:41+00:00Added an answer on June 15, 2026 at 6:19 pm

    You need to remove the query string from your rewrite rule, that gets appended automatically:

    RewriteRule ^search/?$ search.php [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following apache rewrite rule: RewriteEngine On RewriteRule ^id/([^/\.]+)$ item.php?id=$1 [L] and
The idea is to use www.example.com/admin/#!/12345 as www.example.com/admin/user.php?id=12345 This is the rewrite rule Im
I am using the following rewrite rule: RewriteRule ^search/(.*)/(.*) search.php?letter=$1&num=$2 [NC,L] It works fine
I have the following rewrite rule in my .htaccess file: RewriteRule ^([^/]+)/([^/]+)/(tab:([^/]+)/?)?(scope:([^/]+)/?)?(sort:([^/]+)/?)?(p:\d+)/?)?$ web/results.php?view=$1&q=$2&tab=$4&searchscope=$6&sortBy=$8&page=$10 [NC,QSA,L]
I have a rewrite rule in .htaccess RewriteRule (.+?\.fid)/ /$1 [L] with a request
I have this rewrite rule that turns foo.com/test (or foo.com/test/) into foo.com/test.txt: RewriteRule ^test/?$
I am trying to use apache-rewrite rule to convert the below URL: http://localhost/foo/bar/news.php?id=24 Into
I have this rewrite rule: RewriteRule ^/?([a-z]{2})/(printers|hdd|scanners|--some 40 more items go here --)/ Note
I have a rwrite rule which is like this: RewriteRule ^30/edit-print-ready-vinyl-banners.html edit_print_ready_form.php?id=30 Now I
these are the rewrite rules I normally use for clean urls, RewriteRule ^([a-zA-Z0-9\-]+)/?$ index.php?pg_url=$1

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.