Category Archives: a-records

Redirect root to subdomain from htaccess file on subdomain server?

We have a website with files on two servers. One server has a subdomain (home.sitename.com). The other is just www.sitename.com.

We have it set up (w/ A-records) so that the domain servers point files with the "home" subdomain to the server with the subdomain "home", and pages with the "www" prefix to the other server.

Now, would it be possible to redirect the www.sitename.com homepage to the home.sitename.com homepage with a mod_rewrite in the htaccess file on the server with the "home" subdomain? Or, would the mod_rewrite need to be in the "www" server's htaccess file?

A little complicated, I know. I'll try to clarify more if needed. Just wondering if this is possible. Thanks!

Point 2 A Records to IP address, separate folders

I have 2 separate A records pointing to the same IP address:

example1.domain.com -> IP
example2.domain.com -> IP

"example1.domain.com" currently points to the root public_html folder (where wordpress is installed)

I would like the second, "example2.domain.com" to end up in:

public_html/example2folder - (where i have installed magento)

How do I edit the .htaccess file correctly to achieve this? Please help!

force Apache2 to respond only on 1 specific URL and not any other

I have multiple A record for the same server IP address, I mean:

URL            DNS res.
goodurl.com    10.0.0.1 
badurl1.com    10.0.0.1 
badurl2.com    10.0.0.1

I would like to configure Apache2 so that it works only with URL goodurl.com and not with any other.

I've found the way to give "access denied" on specific URL "badurl1.com" like this :

<VirtualHost *:80>
    ServerName badurl1.com
    DocumentRoot /var/www
    <Directory /var/www/>
            AllowOverride None
            Order deny,allow
            deny from all
    </Directory>
</VirtualHost>

Is there a more elegant and efficent way to do the same?

Is there a way to configure Apache to be sure that any other future and undesired new A record, will be rejected by default?

thanks in advance for your help

system SO:      Linux 2.6.32-5-amd64  x86_64 GNU/Linux
Server version: Apache/2.2.16 (Debian)

Answer from 127.0.0.1 when pinging my domain

yesterday I have connected up my new domain (let's call it domain.net) using an A-Record to my V-Server, let's give him the IP-Adress 123.45.67.890. Now it should be well configured (on the online panel they said it would be done in less than 24h). Then I set up a apache2 vhost with the following content:

# MAINPAIGE
<VirtualHost *:80>
    ServerName www.domain.net
    DocumentRoot /var/www/domain/mainpage
</VirtualHost>

<VirtualHost *:80>
    ServerName domain.net
    Redirect 301 / http://www.domain.net
</VirtualHost>

# WIKI
<VirtualHost *:80>
    ServerName www.wiki.domain.net
    DocumentRoot /var/www/domain/wiki
</VirtualHost>

<VirtualHost *:80>
    ServerName wiki.domain.net
    Redirect 301 / http://www.wiki.domain.net
</VirtualHost>

When I now want to browse to domain.net, I get a blank page. If I ping it, I get an answer from 127.0.0.1 . Now I thought, this is strange, but when I asked some friends to do the same, they all get the same result.

Looking forward for your answers,

Benni

Creating an exception when pointing a domain using A record (Shopify)

I am setting up a Shopify site using a custom domain. However, I have old links on that domain that I don't want to break once I point it to Shopify. I also have old parked domains on top of this domain that I don't want to break.

Shopify instructs you to set up an A record for the domain (so when I go to www.mydomain.com I see my Shopify store). But I want to set up exceptions such that www.mydomain.com/my-seo-link won't show Shopify, or will allow me to forward to its replacement at Shopify.

An added complication is I also have parked domains on top of my domain that I want to remain pointing to my old server.

Is there such thing as a URI exception to an A record?