Page 1 of 1

how to point different links to the same php script

Posted: Wed Mar 18, 2009 10:57 am
by khaledvic
hey all
I have a problem how to point different links to the same php script like
mysite.com/blog1
mysite.com/blog2
to the same php script exist in mysite.com/blog
not redirect

please

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 11:07 am
by William
If you're using Apache Google mod_rewrite.

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:15 pm
by khaledvic
but have i to add to .htaccess line for every new domain

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:20 pm
by William
khaledvic wrote:but have i to add to .htaccess line for every new domain
If you don't mind me asking, what are you trying to do?

Edit: @php_east Yeah exactly, that's kind of confusing me too.

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:20 pm
by php_east
khaledvic wrote:but have i to add to .htaccess line for every new domain
theres only one domain in your example.

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:29 pm
by khaledvic
ok
but if i need an automatic script which makes subdomains ??
like :
site1.mysite.com
site2.mysite.com
....
to mysite.com/blog.

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:33 pm
by William
khaledvic wrote:ok
but if i need an automatic script which makes subdomains ??
like :
site1.mysite.com
site2.mysite.com
....
to mysite.com/blog.
So you went from wanting mysite.com/blah1 mysite.com/blah2 to custom subdomains?

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:36 pm
by khaledvic
yeah or the first but i prefer the second

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:37 pm
by William
khaledvic wrote:yeah or the first but i prefer the second
If you're wanting "specific' folders/sub domains set to go to that script then you're going to need to add them manually. If you want ALL subdomains or ALL folders to point to that script that's a different story. Which one is it?

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 1:41 pm
by php_east
same thing, what william said applies.
it is actually a redirect that you want, only that you have a choice of mod rewrite or a php redirect, mod-rewrite will probably be the right normal way, but under certain cicumstances, you may prefer php redirect. it all depends on what you are trying to achieve and how you want it done.

easiest way is perhap to send everthing into your main script for processing with mod_rewrite and onward distribution. i'd be interested in what william or others opinion would be.

Re: how to point different links to the same php script

Posted: Wed Mar 18, 2009 2:03 pm
by khaledvic
ok i will point all sub domains to that script

Re: how to point different links to the same php script

Posted: Thu Mar 19, 2009 9:01 am
by khaledvic
???????????????????????????????????????????????????
up