I've got a few domains set up as addon domains on my website, but they can still be accessed by going to www.mynormaldomain.com/mydirectory/ instead of having to go to www.myaddondomain.com What I need basically is a 301 redirect, for those pages in www.mynormaldomain.com/mydirectory/ to redirect to www.myaddondomain.com How would I go about this?
Hope this helps: 301 Redirect 301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently". You can Test your redirection with Search Engine Friendly Redirect Checker Below are a Couple of methods to implement URL Redirection How to Redirect in PHP <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?> How to Redirect in ASP <%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.new-url.com" > How to Redirect in ASP .NET <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.new-url.com"); } </script> How to Redirect in ColdFusion <.cfheader statuscode="301" statustext="Moved permanently"> <.cfheader name="Location" value="http://www.new-url.com"> How to Redirect with htaccess Create a .htaccess file (if does not exists) in your root directory. Redirect permanent / http://www.new-url.com
Meant 301, sorry about that. Would .htaccess have any complications because of the addon domains and subdirectories?
You would have to try it out and see. I would think it would NOT have any complications because the .htaccess file is just a file of indivdual commands. AJ
That should work, however... why are people accessing your site at http://www.mynormaldomain.com/mydirectory? If you don't tell anyone, why would they go there?
Because, I already have a few links that went there, from when I was asking for reviews in the dev stages, and I get about 5 or so uniques a day from it now. :S I suppose it will die out eventually, but for now, this will be the solution.
I get the error, redirection limit for this url exceeded when attempting to go to the address of the addon domain.
It is, seems like there is no solution though. I've asked my host now, and they said that there isn't one. If anybody does find a solution, I'd be very grateful to hear it.
No, fraid not. Did ask, but I never got any answers that worked, all of them made it just bounce between the addon domain and the actual domain until it got confused and gave up.
Yea I get that to. I'll end up creating a new directory and copying the files in there. It works at least.
the top solution from http://www.webconfs.com/how-to-redirect-a-webpage.php is the best solution out there. very generic though