user2630791 user2630791 - 3 months ago 9
Apache Configuration Question

GoDaddy Apache 2.4 - 301 htacces Redirect

I had a perfectly working site before they update the servers, now I can't get redirects working?

That's what I had before:

RewriteEngine On
rewritecond %{http_host} ^site.com [nc]<br/>
rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]<br/>
redirect 301 "contact.html" http://site.com/contact.php<br/>


Please help!

Answer

You have HTML tags in the example you're showing. Also you're surrounding things with non-necessary quotes. This now uses mod_rewrite exclusively.

RewriteEngine On
RewriteRule ^contact.html http://www.site.com/contact.php [R=301,L]

RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,NC,L]

Remember that since GoDaddy is the host, they will have directives in their httpd.conf file that are processed as well as any configurations you add in the .htaccess file.

If for some reason this doesn't work, additionally Godaddy has their own support forums for dealing with issues in configuration of their services.