homepage Welcome to WebmasterWorld Guest from 54.196.69.189
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Wildcard in htaccess
shared ip no access to httpd.conf
plusz




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

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

 

jdMorgan




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

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

plusz




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

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

plusz




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

i receive a 404 error page from the provider instead of a wildcard

Achernar




msg:3593223
 5:52 pm on Mar 6, 2008 (gmt 0)

What happens when you enter the IP address of the server instead of the site's hostname? Do you still see the site?

plusz




msg:3593542
 11:47 pm on Mar 6, 2008 (gmt 0)

no , i see the error 404 page of the host

jdMorgan




msg:3593590
 1:07 am on Mar 7, 2008 (gmt 0)

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

Achernar




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved