It’s wrong that, the bar is missing:
RewriteRule (.*) http://novodominio.tk$1 [R=301,L]
That’s what’s right:
RewriteRule (.*) http://novodominio.tk/$1 [R=301,L]
I recommend adding a rule to prevent infinite redirect like this:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Options +FollowSymLinks
#verifica se já está no novo dominio (não adicione http: na frente)
RewriteCond %{HTTP_HOST} !adota-me.tk$ [NC]
#redireciona
RewriteRule (.*) http://adota-me.tk/$1 [R=301,L]
A hint, it is preferable not to use the IfModule
in the case of mod_rewrite only, because if the server has not enabled mod_rewrite then you will not notice the error and it will seem that it is a problem in . htaccess when the problem is another, remove the <IfModule mod_rewrite.c>
and </IfModule>
, and after this try to run . htaccess on a disabled mod_rewrite server it will send the error:
Internal Error Server
This means you need to enable mod_rewrite, so follow the instructions on this link:
Or contact your hosting support
gives this error now ERR_TOO_MANY_REDIRECTS
– Amadeu Antunes
@Amadeuantunes I will test.
– Guilherme Nascimento
only thing different is Options +Followsymlinks that I did not put because if I put gives this error Internal Server Error The server encountered an Internal error or misconfiguration and was Unable to complete your request. Please contact the server Administrator, [no address Given] and inform them of the time the error occurred, and Anything you Might have done that may have caused the error. More information about this error may be available in the server error log.
– Amadeu Antunes
http://pastebin.com/zetrFAx8
– Amadeu Antunes
thus I have now http://pastebin.com/jEBeQJAW has no error but does not direct
– Amadeu Antunes
rewrite.load is in the mods-enabled file list
– Amadeu Antunes
Internal Server Error The server encountered an Internal error or misconfiguration and was Unable to complete your request. Please contact the server Administrator, [no address Given] and inform them of the time the error occurred, and Anything you Might have done that may have caused the error. More information about this error may be available in the server error log.
– Amadeu Antunes
is making that mistake
– Amadeu Antunes
when doing sudo a2enmod rewrite appears Module rewrite already enabled
– Amadeu Antunes
@Amadeuantunes deletes all . htaccess content and adds only that
RewriteEngine On
and tells me if it still gives the error "Internal error server"– Guilherme Nascimento
yes gives that error
– Amadeu Antunes
@Amadeuantunes I walked a little away, call me on chat as soon as possible, I do not know if solved your problem with the server
– Guilherme Nascimento