Problems doing a URL redirect in .htaccess
I've tried dozens of different "solutions" and syntaxing (Redirect, RewriteCond, RewriteRule, Redirect 301, etc) and I just can't get this to work. I often get the "redirect loop" -error or the redirect doesn't work at all, or I get it working with only www.thesite.com and not http://www.thesite.com
What I want to do:
When the user goes to mysite.com I want him or her redirected to mysite.com/#anchor
And if the user goes to www.mysite.com I want him or her redirected to mysite.com/#anchor as well
...and if the user goes to http://www.mysite.com I want him or her redirected to mysite.com/#anchor
...and yea, I can only get one of these working at a time (or I get a loop).
My .htaccess file without any redirects:
Code:
# enable basic rewriting
RewriteEngine on
# enable symbolic links
Options +FollowSymLinks
# enable allowoverride privileges
<Directory /www/replace/this/with/actual/directory>
AllowOverride Options
</Directory>
# do not allow anyone else to read your .htaccess file
<Files .htaccess>
deny from all
</Files>
# forbid viewing of directories
Options All -Indexes
# disable the server signature- helps with preformance
ServerSignature Off
Re: Problems doing a URL redirect in .htaccess
Welcome to TalkGraphics
What Xara product are you using?
Re: Problems doing a URL redirect in .htaccess
<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
window.location="http://www.yourdomain.com/";
// -->
Place into the HEAD section by using a placeholder or via web properties dialogue, though whether it works with an anchor I don't know
Re: Problems doing a URL redirect in .htaccess
It is simple
Just add Redirect 301 / mt-example.com
Re: Problems doing a URL redirect in .htaccess
This one is correct code for redirection
Quote:
Originally Posted by
diyaldin
It is simple
Just add Redirect 301 / mt-example.com
Re: Problems doing a URL redirect in .htaccess
This is simple code
E.g
Redirect 301 / mt-example.com
Re: Problems doing a URL redirect in .htaccess
Is there an echo in here? :rolleyes:
Re: Problems doing a URL redirect in .htaccess
This source might help you redirecting page through 2 to 3 methods please check
https://support.google.com/webmaster...er/93633?hl=en