Login | Iscriviti | FAQ
Anonymous

How to create dynamic subdomains in htaccess php?

+ Rispondi al messaggio

4 messaggi Pagina 1 di 1


How to create dynamic subdomains in htaccess php?

da mahajan_php » mer mag 02, 2012 5:52 am

hi,

I wanna to create dynamic subdomains using htaccess. How can i create subdomains like my website

www.example.com/Html/home.php?type=jobs

to

jobs.example.com


Thanks
Ramson
Avatar utente

mahajan_php

  • Messaggi: 13
  • Iscritto il: lun feb 20, 2012 1:09 pm

Re: How to create dynamic subdomains in htaccess php?

da XainPro » mer mag 02, 2012 7:29 am

in your HTACCESS FILE WRITE

Codice: Seleziona tutto
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com/Html/home.php?type=$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([a-z0-9-]+)/? http://$1.example.com [R=301,NC,L]


Replace both instances of "example.com" with your domain name.
it will do
301 Redirect
http://www.example.com/Html/home.php?type=jobs
to
jobs.example.com
Avatar utente

XainPro

  • Messaggi: 3933
  • Iscritto il: ven feb 17, 2012 8:10 pm

Re: How to create dynamic subdomains in htaccess php?

da srinivastamada » gio mar 24, 2016 4:46 pm

Create Dynamic Subdomains using PHP and Htaccess

http://www.9lessons.info/2016/03/how-to ... ccess.html
Avatar utente

srinivastamada

  • Messaggi: 1
  • Iscritto il: gio mar 24, 2016 4:45 pm

Re: How to create dynamic subdomains in htaccess php?

da saeednri2 » sab set 03, 2016 11:51 am

Step 1
Go to your domain DNS(Domain Name Settings), click add zone record.
Step 2
You need to create a custom A record to serve all your subdomains. Select A record, HOST * POINTS TO: Your ID Address(Eg: 106.21.252.71)
Step 3
Repeat the same for HOST @, here is the listed A records
Step 4
Now add CNAME record, HOST www POINTS TO @ this refers to your IP address.

Create Dynamic Subdomains CNAME ZONE settings add

Step 5
CNAME list should be in following way.

Create Dynamic Subdomains CNAME record settings

Step 6
Save all of your domain DNS settings.
---------------------------
طراحی سایت
Avatar utente

saeednri2

  • Messaggi: 4
  • Iscritto il: sab set 03, 2016 9:19 am


+ Rispondi al messaggio

Pagina 1 di 1