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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:54:00+00:00 2026-05-13T21:54:00+00:00

how can i redirect index.php?search= to the base url? I tried it with this

  • 0

how can i redirect index.php?search= to the base url? I tried it with this code:

redirectMatch 301 ^/index.php?search=(.*) http://www.yoursite.com/

but then the page loops the code if i enter the site domain..

  • 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-13T21:54:00+00:00Added an answer on May 13, 2026 at 9:54 pm

    mod_alias does only work on the URL path and not the query:

    mod_alias is designed to handle simple URL manipulation tasks. For more complicated tasks such as manipulating the query string, use the tools provided by mod_rewrite.

    So try mod_rewrite instead:

    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^search=(.*)
    RewriteRule ^/index\.php$ /? [L,R=301]
    

    Or more general:

    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^([^&]*&+)*search=([^&]*)
    RewriteRule ^/index\.php$ /? [L,R=301]
    

    And if you want to use this rule the .htaccess file in your root directory, remove the leading slash from the patterns.

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

Sidebar

Related Questions

How can I redirect http://domain.com/blog/index.php/weblog/rss_2.0/ to http://www.domain.com/feed/ with .htaccess? The website has 3 domains
public function index() { $this->redirect('/'); } I will just go insane soon... How can
How can I redirect someone who types http://domain.com/+abc (this should only apply to alphanumeric
How can I redirect to current url after logout? HTLM for logout: <a href=<?php
Is there any way I can redirect my urls to only use http://www.domain.com instead
Dear folks, Currently a rewrite should redirect /index.php to /en/home And for that this
Currently my htaccess file contains this rule, to redirect website.org/index.php to website.org/en/home RewriteRule index.php
I have a url redirect controller called go. It can redirect topic model and
How can I redirect www.mysite.com/picture/12345 to www.mysite.com/picture/some-picture-title/12345? Right now, /picture/12345 is rewritten on picture.aspx?picid=12345
I'm trying to redirect index.php files to the root /, I've searched around and

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.