CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2006
    Posts
    49

    Question how to map URL to some name

    hi

    if we write www.yahoo.com\news, it will open www.yahoo.com\section=news
    what is that called? how i can achive that url mapping?
    Where i have to specify which page to open when i write www.mywebsite.com\mypage so that it will open mypage section?

    means it should work like this :

    www.domain.com/index.jsp?section=Cash%Managment => www.domain.com/CashManagment

    I am using netbeans. DO i have to add filter in web.xml? how to do that? what type of filter class i have to create and what to write?
    Last edited by ujjvalpandya; June 17th, 2008 at 08:00 AM. Reason: adding more info

  2. #2
    Join Date
    Mar 2008
    Posts
    11

    Re: how to map URL to some name

    I'm not sure if this answers every question that you asked, but I hope this helps somewhat. If you type in something like the following in your web browser:
    http://yahoo.com/news
    and find that you get taken to:
    http://news.yahoo.com
    This simple url syntax is referred to as a subdomain. The syntax for them is as follows:
    http://subdomain.domain.com
    However, not every site has a subdomain for each directory in their site. If you wanted to make a subdomain on your website, you'd have to look in the control panel of the site. Sometimes they have an option that lets you add a subdomain.
    Another alternate option would be to get a site that has wildcard enabled on it. You could check with your ISP to find this out. If you have wildcard enabled on your site, then I think what happens is that every directory after the domain.com/ is automatically also a subdomain. So if you were to create:
    domain.com/news
    it would also be
    news.domain.com

    Hope this helped somewhat...

  3. #3
    Join Date
    Sep 2006
    Posts
    49

    Exclamation Re: how to map URL to some name

    Quote Originally Posted by hopefulcd
    I'm not sure if this answers every question that you asked, but I hope this helps somewhat. If you type in something like the following in your web browser:
    http://yahoo.com/news
    and find that you get taken to:
    http://news.yahoo.com
    This simple url syntax is referred to as a subdomain. The syntax for them is as follows:
    http://subdomain.domain.com
    However, not every site has a subdomain for each directory in their site. If you wanted to make a subdomain on your website, you'd have to look in the control panel of the site. Sometimes they have an option that lets you add a subdomain.
    Another alternate option would be to get a site that has wildcard enabled on it. You could check with your ISP to find this out. If you have wildcard enabled on your site, then I think what happens is that every directory after the domain.com/ is automatically also a subdomain. So if you were to create:
    domain.com/news
    it would also be
    news.domain.com

    Hope this helped somewhat...
    hi. thanks for your answer.but i think i was not able to explain my question.

    i want , if i type

    www.mywebsite.com\news
    it should open the www.mywebsite.com\section=news.

    as per my info, i have to add some filtering in my web.xml. but not sure what to do for that.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: how to map URL to some name

    Changes of that nature (sub.domain.com) can only be done by changing your DNS records. You can create a subdomain and point it. If you don't want to use DNS, then you can only change what comes after the domain.com/ itself.

    However, you cannot control URLs through an xml file. The closest you come to that is using Apache's URL rewrite mod. But, you will have to set the rules within the .htaccess file.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Sep 2006
    Posts
    49

    Question Re: how to map URL to some name

    Quote Originally Posted by PeejAvery
    Changes of that nature (sub.domain.com) can only be done by changing your DNS records. You can create a subdomain and point it. If you don't want to use DNS, then you can only change what comes after the domain.com/ itself.

    However, you cannot control URLs through an xml file. The closest you come to that is using Apache's URL rewrite mod. But, you will have to set the rules within the .htaccess file.
    can you please tell me how to do that using .htaccess file? what to write and where to put that file?

  6. #6
    Join Date
    Sep 2006
    Posts
    49

    Exclamation Re: how to map URL to some name

    and i want to ask one mroe thing, will this .htaccess work also with jsp , or its only for php?

  7. #7
    Join Date
    May 2002
    Posts
    10,943

    Re: how to map URL to some name

    The file .htaccess is used by Apache. The ability to rewrite the URL comes when you have mod_rewrite installed.

    http://www.yourhtmlsource.com/sitema...rewriting.html
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  8. #8
    Join Date
    Sep 2006
    Posts
    49

    Question Re: how to map URL to some name

    I have create one .htaccess file as follows :

    RewriteEngine on
    RewriteRule ^\./old\.html$ ./new.html

    i have also tried :

    RewriteEngine on
    RewriteRule ^old\.html$ new.html

    i have put this in my prj folder of netbeans under WEB-INF, also i try to put in ROOT PRJ FOLDER . But it always open old.html page. Why is it not working?

    my URL is actualy : http://localhost:8080/DeepDive/old.html
    do i have to create filter for localhost? wht will be it?


    and i have tomcate 6.0 ver. will it have mod_rewrite ? or else how to install it?

    and i am not able to find httpd.conf file, where i can check for mod_rewrite.
    Last edited by ujjvalpandya; June 23rd, 2008 at 05:45 AM. Reason: extra info

  9. #9
    Join Date
    May 2002
    Posts
    10,943

    Re: how to map URL to some name

    Well, the best way to get any information on it, is to use its webpage. And your httpd.conf file should be in some folder within the Apache directory. Either way, your computer does have a search feature.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  10. #10
    Join Date
    Sep 2006
    Posts
    49

    Re: how to map URL to some name

    Quote Originally Posted by PeejAvery
    Well, the best way to get any information on it, is to use its webpage. And your httpd.conf file should be in some folder within the Apache directory. Either way, your computer does have a search feature.
    Thx SIR, i have already used that SEARCH feature, but i didnt get, thts y i have asked. anyway, will try to get mroe info from the link which u gave of apache.

    thx.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured