httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [users@httpd] mod_rewrite issue – what do the log files say?
Date Tue, 15 Jul 2014 13:09:56 GMT
Hello users!

I have an account on a shared server and the company told me
that there is absolutey no way I can see the access logs.

Being just a user, I never set up a webserver.

I tried the htacces tester, though there is no support of
the SERVER_NAME variable.

I read a lot about mod_rewrite and tried to modify a rule.

It seems to work from my not-even-amateur point of view, but
it would be absolutely great if someone could test that rule
for me, please.

The conditions are:

1. %{SERVER_NAME} ^(.*)\.?$

–> That should match $every-domain.$every-tld plus optional
   trailing dot

––> e.g. some-domain.some-tld.

––> e.g. (with and without trailing dot)

2. "%{HTTP_HOST} ^.*\.%1$

–> That should match $everything-in.front.of.%1 – where %1
   is the the above specified part in parantheses (.*), e.g.
   some-domain.tld or (without trailing dot)

––> e.g.

––> e.g. (without trailing dot)

The rule is:

^(.*)$ http://%1/$1 [L,R,NE]

–> That specifies everything(?) to be variable $1 and puts
   everything after http://some-domain.tld/

––> e.g. http://some-domain.tld/whatever/there-is.html

  I'm not absolutely sure about this one, maybe some could
  explain that better – thanks!

All together:

RewriteCond %{SERVER_NAME} ^(.*)\.?$
RewriteCond %{HTTP_HOST} ^.*\.%1$
RewriteRule ^(.*)$ http://%1/$1 [L,R,NE]

Thanks very much for your help! : )

Kind regards,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message