Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.9k views
in Q2A Core by
Hi there,

I have a couple of domains parked on my main domain.

Redirects are all working fine, except for the Q&A folder, which keeps displaying the parked domain. I tried everything I could think of and also the solutions that were already posted here....in both my main .htaccess and the one in the Q-A folder, to no avail.

So - www.parkeddomain.com/Q-A

should redirect to www.maindomain.com.nl/Q-A

I must  be missing something.... any help is very much appreciated...!

1 Answer

+1 vote
by

I think this should work, put it in the htaccess on the root of the parked domain:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.parkeddomain.com$ [NC]
RewriteRule ^Q-A/(.*)$ http://www.maindomain.com/Q-A/$1 [R=301,L]
by
Thanks for your answer. You'd think this would work, but I still see the parked domain.... I think something in the (untouched) .htaccess in the Q-A folder is conflicting but I don't really know enough about it to see what it is.
by
If you also have an .htaccess in the QA folder it may be overriding the root one. Try renaming it to x.htaccess and see if that works.
by
Yes, that worked! The .htaccess came with the program so I assumed it was needed.

Thanks!
by
Hi again...

I just found out that since I deleted the .htaccess from the Q-A folder, the tags don't work anymore.

Can you please tell me how to fix this? That would be awesome!

My .htaccess is now:

DirectoryIndex index.php
RewriteEngine On
RewriteBase /q-a
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]

Thanks so much for your help and also for the amazing  Question2Answer program.
by
Did you delete the htaccess from the main domain or parked domain? The code I posted should only be in the htaccess of the parked domain, and you probably don't need anything at all on the parked domain apart from htaccess.

Then on your main domain you just need the usual Q2A htaccess and none of the redirection stuff.
by
Hmm, I think you're misunderstanding me.

The parked domain already points to the main domain, it doesn't have it's own space. So whenever I type in www.parkeddomain.com/whatever it goes to the main domain.

The problem is that only the q-a folder (and only this folder, all other links and folders are working OK) keeps showing the parked domain in the URL so google thinks it's another website and might punish me for double content.

The problem must be a conflict with the .htaccess in the q-a folder, because I deleted (renamed) the htaccess from the q-a folder and all the redirects from the parked domain then worked correctly... but the links in the script didn't work anymore.

Hope this clears things up!
by
Update:

I "fixed" this by turning off the pretty URL structure option and deleting the .htaccess in the q-a folder.

It now looks a little bit less neat but at least it works ....

If anybody has another solution please don't hesitate to post it here!
by
Yeah, not sure I'm following, sorry... so you're saying everything on the parked domain redirects to the main domain OK? So parked.com/q-a/123/whatever redirects to main.com/q-a/123/whatever ?

Where is the parked domain being displayed? You mean all the links on main.com show as parked.com ??

Are you able to post the domains so I can take a look myself?
by
It's pretty simple actually.

My redirects are working fine.. all of them. All my old files on the old (and now parked) domain are being redirected to the same files on my new domain.

When I type the parked domain I always get and see the new domain in the addressbar.... just not when I type in the q-a folder -> it keeps showing the parked domain. I have more parked domains and it does this for all of them.

The problem is within the .htaccess of the q-a folder, because when I rename the.htaccess the redirect works as it should.

It has to do with the rewriting to get the pretty URL structure (you can choose this in admin o the q-a script) which works better for SEO, because I now turned it off and it's working properly... just without the pretty file structure, but I don't really care about that.

I'd rather not post the domain cause I'm sure 100s of people will come and check the site and it messes up my statistics like bounce rate, etc.

If you want to reach me you can though, just look at my profile and check one of the sites!
...