I am pretty novice when it comes to hard .htaccess mods, so I beg of your help to do the following:
I want to redirect every call to any page from one subdomain*domain*come to another with the same parameters. This forum won't let me post my question here though, stating "Too many live links/images found in your post content. Please edit your post or contact the administrator." Annoying
So, I attached it as a text file...
.htaccess redirect subdomain*domain*come to another domain with the same parameters
|
Light Poster
|
|
| 21Oct2010,17:17 | #1 |
|
|
|
Light Poster
|
|
| 21Oct2010,17:19 | #2 |
|
The basic gist (if this forum allows me to post more "links"... we'll see): is:
I am looking for .htaccess code so that subdomain.olddomain.com/index.php?many_variables_here permanently redirects to (with the addressbar in the browser reflecting the new) subdomain.NEWdomain.com/index.php?many_variables_here thanks |
|
Go4Expert Founder
|
![]() |
| 21Oct2010,17:50 | #3 |
|
We have the answer in the SEO FAQ's thread but I will post it once again here as well.
I just changed my domain name. How can I switch without losing my rankings? Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]
Also regarding links new user with post counts less than 10 are not allowed to links to keep the spammers away and I hope you will understand this. |
|
Light Poster
|
|
| 22Oct2010,01:50 | #4 |
|
Thanks shabbir, but that does not work for me (just tried it).
My reply is in another text file, attached, as your spam check is too good. This is a coding forum, and I have no way to put url examples... i wish i knew what was triggering it... The key is that I need subdomain (not w w w) * domain * com slash parameters to forward to subdomain (not w w w) * NEWdomain * com slash parameters BUT: note that I only want that specific subdomain to forward. I do not want the w w w * olddomain to forward, just that subdomain. Thanks! PS: For what its worth, I tried your code exactly, just exchanging my real domain names with "old-domain" and "new-domain" and got no results. I expected with the (www\) I would've redirected everything, but it is not. At least my browswer addressbar does not change to the new domain. Last edited by shabbir; 22Oct2010 at 07:46.. Reason: Attachment Content |
|
Go4Expert Founder
|
![]() |
| 22Oct2010,07:45 | #5 |
|
The trigger is http and www.
Now to answer your question www is also a subdomain of your domain.com |
|
Light Poster
|
|
| 22Oct2010,12:26 | #6 |
|
thanks for the clarification.
On the code you posted above: why does it not work for me with parameters? can you break down the code... what is each part doing? maybe if I better understood this, I could understand why it isn't working. Thanks! |
|
Light Poster
|
|
| 26Oct2010,04:12 | #7 |
|
Here's my solution: website: webmasterworld.com/apache/4220225.htm
|

