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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:57:22+00:00 2026-05-24T19:57:22+00:00

I have browsed the other topics, including this one: Mod_rewrite invisibly: works when target

  • 0

I have browsed the other topics, including this one: Mod_rewrite invisibly: works when target is a file, not when it's a directory, but I can’t find a solution to my problem.

I have the following rewriting rule:

RewriteRule ^([a-zA-Z0-9_-]+)$ ./index.php?s=$1 [L,NC]
RewriteRule ^([a-zA-Z0-9_-]+)/$ ./index.php?s=$1 [L,NC]

What it does is to write anything like http://myaddress/parameter to http://myaddress/index.php?s=parameter and show this new rewritten address in the browser’s address bar.

How can I make rewriting without showing the rewritten URL in the address bar?


Edit

This is the content of my .htaccess file:

DirectoryIndex index.php

RewriteEngine On

RewriteRule ^([a-z0-9_\-]+)/?$ index.php?s=$1 [L,NC,QSA]
RewriteRule ^([a-zA-Z0-9_-]+)\/?([a-zA-Z0-9_-]+)\/?$ index.php?u=$1&s=$2 [L,NC]
RewriteRule ^([a-zA-Z0-9_-]+)\/?([a-zA-Z0-9_-]+)\/?([a-zA-Z0-9_-]+)\/?$ index.php?u1=$1&u2=$2&s=$3 [L,NC]
  • 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-24T19:57:23+00:00Added an answer on May 24, 2026 at 7:57 pm

    1. No need for 2 rules that do the same job (the only difference is presence of trailing slash).

    2. No need to have a-zA-Z in pattern if you have [NC] flag — a-z is enough.

    3. Try rule without ./

    Considering all the above mentioned the rule will become:

    RewriteRule ^([a-z0-9_\-]+)/?$ index.php?s=$1 [L,NC,QSA]
    

    P.S.
    I have also added the QSA flag to preserve original query string (if present).

    The rule is tested and is working fine. If it still does not work for you then post ALL rewrite rules that you have.

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

Sidebar

Related Questions

I have browsed thru other postings on S/O, but I can't find a solution
I've browsed the other links in regards to this but I can't get it
I have browsed lift's MegaProtoUser and encountered this construction: ??(Last Name) . Can anyone
I have noticed that Firebug and some other addons I have browsed require that
This may be a n00b topic but, anyways, I have been having a rather
Hey Everyone. I'm a first time poster, but I've browsed this site a number
i cam across some older topics about this but since there is a lot
I have an algorithm problem that I came across at work but have not
I currently have a issue with firefox, where all other browser behave in the
I have an ASP.NET web application the entire site is browsed over HTTPS using

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.