Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    1

    Default query string to subdomain

    Hi,
    I am very new to htaccess so I need just a little help to get me started. I think I would also need dynamic subdomains configured for this.

    I would like a visitor to my site to see a link like this to change to a new city:
    http://newyork.mydomain.com


    the real link: http://class.mydomain.com/index.php?region=245

    With the query string to my php/mysql script would be hidden. This is what the script would get.


    There are several hundred region numbers each corresponding to a specific city and I don't actually want to create a subdomain for each. I am looking to do this to make the urls friendly and improve SEO. The site will be similar to kijiji or craigslist.

    Any help would be appreciated.

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    To avoid the need for creating each domain manually, you may wish to consider creating a wildcard domain. There's many threads around here covering that topic.

    As for displaying the content of something like http://class.mydomain.com/index.php?region=245 without displaying that in the browser's address bar, you would want to use mod_rewrite. The Apache documentation for mod_rewrite is rather comprehensive.

Similar Threads & Tags
Similar threads

  1. Helo string
    By At0m in forum New User Questions
    Replies: 0
    Last Post: 11-17-2006, 02:55 AM
  2. Redirecting to an URL with query string [moved]
    By DeadManWalking in forum New User Questions
    Replies: 4
    Last Post: 02-07-2006, 07:17 PM
  3. phpsuEXEC and url's with query string
    By anup123 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 06-19-2005, 11:35 AM
  4. Ubersmith Authentication string
    By t1tec in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-03-2004, 08:49 AM
  5. Package String
    By bespoke in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-30-2002, 12:35 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube