httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "--[ UxBoD ]--" <>
Subject [users@httpd] mod_rewrite woes
Date Thu, 20 Jan 2011 20:00:33 GMT
Hello all,

I am switching from LiteSpeed webserver to Apache and having a real issue with mod_rewrite.
 First of all here are the details of apache:

Server version: Apache/2.2.17 (Unix)
Server built:   Jan 20 2011 16:15:22
Server's Module Magic Number: 20051115:25
Server loaded:  APR 1.4.2, APR-Util 1.3.10
Compiled using: APR 1.4.2, APR-Util 1.3.10
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D HTTPD_ROOT="/usr/local/apache"
 -D SUEXEC_BIN="/usr/local/apache/bin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

I have included the necessary module:

LoadModule rewrite_module     modules/

and have tested that it works by touching a file called test.html and making it redirect to
another site using the following .htaccess rule:

Redirect /test/test.html

Now the issue comes when I am trying to redirect a domain URL in the following formats:

and wish them all to be re-written as:

I have tried using the following rule:

RewriteCond %{HTTP_HOST} ^$ [NC,OR]
RewriteCond %{HTTP_HOST} ^$ [NC,OR]
RewriteCond %{HTTP_HOST} ^$ [NC,OR]
RewriteRule ^(.*)$$1 [R=301,L]

But it always ends up just showing the domain I entered and not re-directing :(

Am I doing something really stupidly crazy as I do not have much more hair to pull out :)
Looking for some kind assistance.
Thanks, Phil

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message