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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:26:56+00:00 2026-06-14T02:26:56+00:00

I need to rewrite this url : http://localhost/blog/post.php?id=48 into http://localhost/blog/post/48 which is in localhost

  • 0

I need to rewrite this url :
http://localhost/blog/post.php?id=48
into
http://localhost/blog/post/48
which is in localhost of my xampp.
I have created .htaccess file and wrote the below code to work.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^post/([0-9]+)/?$ post.php?id=$1 [NC,L]
</IfModule>

I have tried redirection and all other stuff. Everything is working but my rewrite rule alone not working. I’ve searched and tried all options but i couldn’t succeed. Plz anyone help me out on 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-14T02:26:57+00:00Added an answer on June 14, 2026 at 2:26 am

    Finally its working with below code:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/ # This is the thing which made me struck with this
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^post/([0-9]+)/?$ post.php?id=$1 [NC,QSA]
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a rewrite rule for this url http://localhost/~user/frame/lib/index.php?/controller/method/12/22/ How can i rewrite it
I need rewrite this url http://adresa.com/article.php?act=view&id=1113 to http://adresa.com/view/1113 I make it with mod_rewrite in
I have the following url: http://example.com/folder/index.php?module=centrale&DIO0=1 I need this page to be availeble with
I have this url: http://www.mydomain.com/index.html And want a rule to rewrite the above into
I have this URL: http://hostX.site.com/some_path_here/filename.jpg and need to rewrite it to: http://host.site.com/same_path_here/filenameX.jpg Can you
I have a URL like this http://www.mysite.com/one/two/nearly_anything#!0lJ_PghzRwHtOyL3BkSouCFVh61mV_I0ZUPSipZDKPFW9xc from which I need to get the
this question is Basic but important. i need to rewrite php url using .htaccess
I have url as http://www.mydomain.com/levels/home?mode=48bb6e862e54f2a795ffc4e541caed5c . I need to change this url to http://www.mydomain.com/medium
I need to rewrite some Python code into PHP (don't hate me, a customer
i have a mixed aspx/MVC webapp project and need to rewrite incoming URL's either

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.