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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:12:37+00:00 2026-05-29T09:12:37+00:00

I have mod rewrite enabled to remove all page extentions…. This is done in

  • 0

I have mod rewrite enabled to remove all page extentions….

This is done in httpd.conf as I am using apache on windows

the setup I have is

<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   Options +Indexes
   RewriteEngine On
   RewriteCond %{SCRIPT_FILENAME} !-d
   RewriteRule ^([^\.]+)$ $1.html [NC,L]
</IfModule>

and this makes domain.com/bookings.html

appear as domain.com/bookings

I have php enabled in html files, so it parses all pages for php

But I have now put a search box on my site, and if I search for “music” it will use the url:

domain.com/search?q=music

I would like my urls to look like:

domain.com/search/music

But also, I would like to be able to type

domain.com/search/abba

And it would load the page “search.html” lets call it “search” and it would add the parameter ?q=abba , but then still look like the above example in the URL bar

I’m sure this can be achieved with mod rewrite but I am not sure how to phrase the expression.

Thanks in advance for any help I receive 🙂

  • 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-29T09:12:38+00:00Added an answer on May 29, 2026 at 9:12 am

    use the kind of URLs in your html: domain.com/search/music

    add this in your .htaccess file in your DocumentRoot.

    Options +FollowSymLinks +Indexes -MultiViews
    RewriteEngine on
    RewriteBase /
    
    RewriteCond %{REQUEST_URI} (search)/([\w\d]+) [NC]
    RewriteRule ^ %1.html?q=%2 [L,QSA]
    
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.html [NC,L]
    

    or add this to your .conf file

    <IfModule mod_rewrite.c>
       Options +FollowSymLinks
       Options +Indexes
       RewriteEngine On
    
        RewriteCond %{REQUEST_URI} (search)/([\w\d]+) [NC]
        RewriteRule ^ %1.html?q=%2 [L,QSA]
    
        RewriteCond %{SCRIPT_FILENAME} !-d
        RewriteCond %{SCRIPT_FILENAME} !-f
        RewriteRule ^([^\.]+)$ $1.html [NC,L]
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to rewrite URLs using mod_rewrite. It is enabled in httpd.conf and
I have enabled mod_rewrite in my Xampp Apache. When I run my phpinfo() page,
On my computer I have an Apache server with rewrite and userdir modules enabled.
I have enabled enabled mod_rewrite and have the following in httpd.conf: <Directory /> Options
Apache Mod-Rewrite, I have a problem not a error as such but the following
I have a relatively complex .htaccess file to control page requests, this currently redirects
I have installed Magento in Godaddy shared hosting with apache mod_rewrite enabled while installing
In my site, I have used mod rewrite to make search engine and user
I have Apache with mod_rewrite, and whenever I enter a URI with an accented
I have a website that employs a generic mod_rewrite rule to push all requests

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.