if my url is
www.x.com
n i have an inner directory
www.a.x.com
how do i check the url is right or not n lead it to an error page

you mean like

$_SERVER['SERVER_ADDR']; //or
$_SERVER['DOCUMENT_ROOT'];

?

I believe you are trying to create a sub directory on your domain?

So for example.....if your domain was www.me.com and you wanted to create a sub directory as www.you.me.com ....

First you need to create the sub directory on your domain as you then point your browser to http://you.me.com or http://me.com/you

You will of course need a document in the sub directory such as an index.htm or something. Hope this helps and if not then feel free to get in touch.


Justin

if my url is
www.x.com
n i have an inner directory
www.a.x.com
how do i check the url is right or not n lead it to an error page

see its li this
i have www.me.com
n created www.you.me.com
incase if i give www.yo.me.com it shud not say server not found instead lead me to my home pages error page.. sayin url typed is wrong!

sub domains generally replace the 'www' default, as the www is the primary domain pointer, most domain names can be reached without adding the www prefix for example http://x.com and this will point directly to the same location adding the www.

http://a.x.com would be the correct use of the sub domain with the main site appearing on http://www.x.com and any other sub's http//here.x.com

unless you have named you sub 'www.a' which i would not recommend as you can get some very odd results from domain control panels adding extra '.'s, then your sub would be http://www.a.x.com.

if you want the www use a hyphen or an underscore to make it better accepted by the world wide dns www-a or www_a. so you would use http://www-a.x.com and http://www_a.x.com

Also remember it can take 24 - 48 hours for any new sub domain to be populated across the world dns records to be accessible from anywhere in the world.

hope that helps.

no no!!! u guys not gettin the right stuff!!!

no no!!! u guys not gettin the right stuff!!!

Could you please explain with as much detail as possible so we can help you, otherwise we are shooting fish in the ocean. :)

Hmm have you uploaded a file or 'webpage' to your sub domain folder?

If you have no file to direct to then you will only get to your server as their is nothing their for it to show!

My advice is to upload a notepad document named index.html to the folder on your server that is the subdomain! Type some html in the document such as <html>hello</html>

Once this is done you should be able to type in www.me.com/you.index.html then it will work but you should just see the hello on a plain white screen.

Sorry if we are not getting it right but we are trying so please explain in more detail

Justin

do you mean your sub domains are looping back to the same location as the main site?

if so you need to change the root folder the sub domain points too

on my domain i have 3 sub domains, each points to a different root folder path on the host machine like this:

/home/www/x.co.uk
/home/www/1.x.co.uk
/home/www/2.x.co.uk
/home/www/beta.x.co.uk

each folder after the /www/ is a new root folder for that sub, and although each sub operates on the same ip as the main domain the host routes the traffic to each sub correctly.

so for each:

http://x.co.uk/index.php
http://1.x.co.uk/index.php

Would show a different site, or would error 404 resource not found for a site root that contains nothing / doesn't exist.

i think whats happening with yours is that the sub you have created is pointing to the same location on the server as your main domain, and its looping back on itself thus creating the problem you are getting.

HMMM k its li this
Try mal.yahoo.com
instead of mail.yahoo.com
then it says server not found but i want it to take me to a error page of yahoo.com n say the url typed is wrong.... i already have an eroor page which is linked if my url is wrong after .com but between http://x.y.com/ it does lead me to an error page

use htaccess file to redirect the error page

Unique Error 404 Pages are something you need to talk to your hosting provider about, IF they allow you to create your own then it should be a simple case of having the custom page in the root of your domain. Depending how their services are set up, you may or may not be able to do this.

Oh,

Are you asking how to set custom error pages?


Well, .htaccess or by using the control panel. Look in you CP for custom page or custom error pages.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.