Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm moving a site from a Synology server to another, and want automatic redirect. I have virtual host on the syno, the site is in domain sub.domain.com. The new site is in newdom.com/sub. This is the httpd-vhost.conf-user file:

NameVirtualHost *:80
<VirtualHost *:80>
ServerName *
DocumentRoot /var/services/web
RewriteLog /volume1/web/logs/rewrite.log

RewriteEngine On
RewriteCond %{HTTP_host} ^(sub\.domain\.com) [NC]
RewriteRule (.*) [%1$1...] [R=301,L]    
</VirtualHost>

<VirtualHost *:80>
ServerName sub.domain.com
DocumentRoot "/var/services/web/bugs"
ErrorDocument 403 "/webdefault/sample.php?status=403"
ErrorDocument 404 "/webdefault/sample.php?status=404"
ErrorDocument 500 "/webdefault/sample.php?status=500"
<Directory />
AllowOverride FileInfo Options
Options FollowSymLinks
Options SymLinksIfOwnerMatch
</Directory>

RewriteEngine on
Options +FollowSymLinks
RewriteRule ^(.∗)$ http://newdom.com/sub/$1 [R=301,L]
ErrorLog "/var/services/web/logs/error-bug.log"

</VirtualHost>

Restart Apache and... Nothing happens, no redirection

The rewrite log says:

10.10.10.60 - - [15/Jul/2010:10:53:41 +0200] [sub.domain.com/sid#1017a370][rid#102f6800/initial] (2) init rewrite engine with requested uri /
10.10.10.60 - - [15/Jul/2010:10:53:41 +0200] [sub.domain.com/sid#1017a370][rid#102f6800/initial] (3) applying pattern '^(.*?)$' to uri '/'
10.10.10.60 - - [15/Jul/2010:10:53:41 +0200] [sub.domain.com/sid#1017a370][rid#102f6800/initial] (1) pass through /

There's nothing in the error.log.

Any help?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

You need RewriteLogLevel <some_number_greater_than_zero> to turn on logging for what's happening.

share|improve this answer
    
Thanks, edited the question with the rewrite.log content –  CharlesB Jul 15 '10 at 8:51
add comment

OK, this was an encoding problem in the configuration file... Redirect now works!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.