htaccess查询字符串在localhost中重写

I have an issue with the rewriting of the query string.

The URL I have is the following:

localhost/www/whours.com/index.php?comp=login_controller/noAuth

and I would like to translate it in:

localhost/www/whours.com/login_controller/noAuth

In my htaccess, currently, there is the following code:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^comp=(.*)$
RewriteRule ^(.*)$  www/whours.com/%1?

and in the index.php:

// Getting the absolute root path
define('ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR);

include_once("App/Core/Config/config.php");
include_once(CORE_PATH . DIRECTORY_SEPARATOR . "Include/autoloader.php");

//echo ('location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?comp=login_controller/noAuth");
if (!isset($_GET['comp']))
{
    header('location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?comp=login_controller/noAuth");
}
$app = new Application();
$app->run();

When I am contacting the URL in localhost it seems the htaccess is not applied and the result is page Error 404 with the following URL: localhost/www/whours.com/index.php?comp=login_controller/noAuth

Could you please give me a suggestion or an help to find where is placed the issue?

Many thanks in advance. Simone

If you want http://www.example.com/www/whours.com/login_controller/noAuth rewritten into http://www.example.com/www/whours.com/index.php?comp=login_controller/noAuth, you must have it the other way round

RewriteRule ^www/whours.com/(.+)$ /www/whours.com/index.php?comp=$1 [L]

Although this looks like www/whours.com might be the document root of your web page. In this case the URL would be rather http://www.example.com/login_controller/noAuth and the rule must look like

RewriteRule ^(.+)$ /index.php?comp=$1 [L]

To rewrite http://localhost/www/whours.com/ or http://www.whours.com to /index.php?comp=login_controller/noAuth replace your rule with

RewriteRule ^www/whours.com/?$ /index.php?comp=login_controller/noAuth [L]

on localhost. This assumes, that .../www/whours.com is your document root, i.e. you have DocumentRoot /path/to/www/whours.com somewhere in your Apache configuration files.

On your production server (www.whours.com), use

RewriteRule ^$ /index.php?comp=login_controller/noAuth [L]