The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 21, 2019, 12:55:56 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: What to write in .htaccess ?  (Read 2750 times)
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« on: April 28, 2009, 02:02:56 PM »

I want to creat a subdomain on my domain with htaccess !

Tried with cPanel - redirect -- not working !

when i enter fish.you.com it redirects me to you.com/fish !

Maybe I need a few  Nerd informations about htaccess rules !

I want to create you.com/fish/wuzup.html to be fish.you.com/wuzup.html !

Something I'm doing wrong but don't know what  D'oh!
Logged

what's up?
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #1 on: April 28, 2009, 04:57:21 PM »

NYdaz,

You can't do that with htaccess.  htaccess is only effective in the domain space where it resides.

Subdomains are DIFFERENT domains.  Being different domains, they have their own domain space
and their own htaccess and are not subject to the htaccess rules in any other domain space.

Bompa
Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #2 on: April 28, 2009, 05:38:15 PM »

errr sort of.

I think if you have the subs wildcarded, and it all points to the same vhost, then you can htaccess rules to the subdomain level.
but yes, to get a user to see a different site you would have to do a 301.

so just to be clear, what URL do you want the user to see in the browser bar?
and what url do you want your software to think they are hitting?

so do you want a user at http://fish.you.com/wuzup.html
but htacces shows the software:  you.com/fish/wuzup.html

Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #3 on: April 29, 2009, 03:28:50 AM »

errr sort of.

You been drinking that cactus beer again?


Quote
I think if you have the subs wildcarded, and it all points to the same vhost, then you can htaccess rules to the subdomain level.

Hmm?  How does one "htaccess" to the "subdomain level"?  No such thing.


Quote
but yes, to get a user to see a different site you would have to do a 301.

Then where would that redirected subdomain go?  Back to the main doc root, because, in your
example, subs are wildcarded back to the same "vhost".  (Infinite loop I think)

It can not be done with htaccess.

Cheesy

Bompa


Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #4 on: April 29, 2009, 05:27:50 AM »

Wait, you're right NB.  If you can wildcard subdomains, (and that is possible with
some cpanels), then the htaccess can simply rewrite an incoming request to the
appropriate subfolder and the incoming request (the subdomain) would remain
in the address bar.

Still, htaccess can not create a subdomain.  Cheesy



Bompa
Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #5 on: April 29, 2009, 07:10:21 AM »

so just to be clear, what URL do you want the user to see in the browser bar?
and what url do you want your software to think they are hitting?

so do you want a user at http://fish.you.com/wuzup.html
but htacces shows the software:  you.com/fish/wuzup.html
I want to be just http://fish.you.com/wuzup.html ... for the users and software

Still, htaccess can not create a subdomain. 
Then what the fish create a subdomain 
Logged

what's up?
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #6 on: April 29, 2009, 03:10:52 PM »

so just to be clear, what URL do you want the user to see in the browser bar?
and what url do you want your software to think they are hitting?

so do you want a user at http://fish.you.com/wuzup.html
but htacces shows the software:  you.com/fish/wuzup.html
I want to be just http://fish.you.com/wuzup.html ... for the users and software

Still, htaccess can not create a subdomain. 
Then what the fish create a subdomain 

The Domain Name System (DNS) server (usually software called Bind) has a record for
each subdomain.  This is what creates a subdomain. If you could see it, you would see
a record for 'www' already.  Also, for the subdomain to wind up accessing the files in
the correct folder on your host, the Apache configuration file (httpd.conf) needs an entry.

If you have cpanel, you might be able to create wildcard subs for your primary domain. In
which case, cpanel does all the modifications for you.

Bompa


Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!