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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:58:49+00:00 2026-06-18T00:58:49+00:00

I am trying to set up a rewrite rule so that anything after localhost/test/{this}

  • 0

I am trying to set up a rewrite rule so that anything after localhost/test/{this} gets forwarded to localhost/test/index.php?{here}

I have access to the server and configuration currently looks like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    <Directory /var/www/test/>
            AllowOverride All
            RewriteEngine On
            RewriteBase /
            RewriteRule ^(.*)$ index.php?$1      
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

But at the moment, instead of showing /localhost/test/index.php?something when visiting localhost/test/something it shows localhost/index.php so it’s rewriting to the wrong place.. any ideas? Thanks

  • 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-18T00:58:50+00:00Added an answer on June 18, 2026 at 12:58 am

    Resolved.. I found that whenever I included AllowOverride All it redirected to /index.php, then spotted I’d left a .htaccess file in there from testing earlier that was messing things up. Removed, updated my rule and now working. Thanks for help!

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

Sidebar

Related Questions

I am trying to use apache-rewrite rule to convert the below URL: http://localhost/foo/bar/news.php?id=24 Into
I'm trying to make a mod_rewrite which can set the language the rewrite: www.domain.com/da/page.php
Im trying to set up a simple rewrite rule but I dont seem to
I'm trying to set up an htaccess rule that'll work with the current permalink
I'm trying to access CodeIgniter URLs without 'index.php'. Here's the steps I've taken: Checked
I have a PHP-based web app that I'm trying to apply Apache's mod_rewrite to.
I have been trying to write a set of htaccess rules that will do
I'm trying to set up page anchors on a website that uses mod_rewrite (Apache2
I'm trying to setup a rewrite rule and I need it to apply to
I'm trying to implement a new ReWrite rule on my local dev machine. I

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.