Welcome to WebmasterWorld Guest from 54.145.209.34

Forum Moderators: Ocean10000 & incrediBILL & phranque

Wildcard in htaccess

shared ip no access to httpd.conf

   
3:16 am on Mar 5, 2008 (gmt 0)

5+ Year Member



I need an advice from an expert in this, i want to create a wilcard for a domain but i have shared ip and no access to Apache configuration file

I tried this...but is not working

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

#handle domain.com wildcard subdomains
rewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).domain.com [NC]
rewriteRule ^(.*)$ /domain.com/$1 [L]

Isn't possible to setup server alias with .htaccess , some tricks i don't know... to make it work

2:20 pm on Mar 6, 2008 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



How, specifically, does your code not work?

You did not post what you expected it to do, so it's rather difficult to diagnose the problem.

Also, can we assume that you have defined these wildcard subdomains in your DNS zone file, and that your server is configured to 'deliver' requests for these subdomains to the filespace where your .htaccess code resides?

If not, then you'll need to do those things first, or you will get "Server not found" errors from your browser, no connection to your server will be made, and so the code will never be executed.

Jim

5:48 pm on Mar 6, 2008 (gmt 0)

5+ Year Member



i have defined the wildcard subdomains in my DNS

i want any test.mydomain.com or test2.mydomain.com to be resolved to mydomain.com ( any fictive subdomain ) to point to my main domain

the provider has itself wildcard , any wildcard i try is resolved to his page not mydomain.com, mydomain.com or www.mydomain.com works but can't trick the wilcard to point to my own page not their page

5:49 pm on Mar 6, 2008 (gmt 0)

5+ Year Member



i receive a 404 error page from the provider instead of a wildcard
5:52 pm on Mar 6, 2008 (gmt 0)

5+ Year Member



What happens when you enter the IP address of the server instead of the site's hostname? Do you still see the site?
11:47 pm on Mar 6, 2008 (gmt 0)

5+ Year Member



no , i see the error 404 page of the host
1:07 am on Mar 7, 2008 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



It may be possible for you to do this if they provide you with a "Control Panel" facility that can enable wild-card subdomains. If not, you will need to contact your host and ask them to enable wildcard subdomains for you.

You cannot do anything more using .htaccess.

Jim

2:40 am on Mar 7, 2008 (gmt 0)

5+ Year Member



no , i see the error 404 page of the host

This means that the server is only configured to accept specific domains (the ones it is configured for). If you want to add new ones, and have no access to the configuration, you're screwed.

If the server had answered with a page from your site, it would have meant that all traffic, regardless of the host header, was directed to the same virtualhost in the apache config. This would have allowed you to rewrite based on elements of the resquest.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month