Dear friends,
I have a domain which contain several sub domains.
What i want is, if user types
http://subdomain.domain.com
(The url should stay like this)
But it should execute the root's index page with a query string
http://domain.com/index.php?query=subdomain
Since i am not strong enough in .htaccess, can you help me with this?
Thanks in advance...
I need help with htaccess file
Moderator: General Moderators
Re: I need help with htaccess file
As long as the domain.com server is handling subdomain.domain.com's requests then you can use mod_rewrite to do that.
Meaning http://subdomain.domain.com takes you to the same content as http://domain.com.
Otherwise I'm not too sure it's possible.
Meaning http://subdomain.domain.com takes you to the same content as http://domain.com.
Otherwise I'm not too sure it's possible.
Re: I need help with htaccess file
Hi,
If my domain is handling the subdomain, then is it possible?
I tried some rewrite conditions, but i got error which did not even load my website..
Thanks for your reply.
If my domain is handling the subdomain, then is it possible?
I tried some rewrite conditions, but i got error which did not even load my website..
Thanks for your reply.
Re: I need help with htaccess file
If what I said is true then yes, it should be possible.agriz wrote:If my domain is handling the subdomain, then is it possible?
You need RewriteCond since that's the only way to know the requested subdomain.
Code: Select all
RewriteCond %{HTTP_HOST} ^(.+)\.domain\.com$
RewriteRule ^/?$ /index.php?query=%1Re: I need help with htaccess file
Hi tasairis,
Thank you for your help.
one general question. In my server, I just created a folder called live.
So we can access it both ways.
http://live.agriz.in or http://agriz.in/live
This live folder contains nothing.
So http://live.agriz.in gives
Forbidden
You don't have permission to access / on this server.
What does it mean?
Thanks
Thank you for your help.
one general question. In my server, I just created a folder called live.
So we can access it both ways.
http://live.agriz.in or http://agriz.in/live
This live folder contains nothing.
So http://live.agriz.in gives
Forbidden
You don't have permission to access / on this server.
What does it mean?
Thanks
Re: I need help with htaccess file
Actually
I used user htaccess code. But it did not call the roots index.php
Other subdomains are working with their own data. But none of them call the index.php of root
Is there any problem with my domain?
Thanks
I used user htaccess code. But it did not call the roots index.php
Other subdomains are working with their own data. But none of them call the index.php of root
Is there any problem with my domain?
Thanks