Redirect dynamic subdomain to same subdomain with subpage. How?

There are several options on the URL redirection wiki page. For example, how about dropping an index. Php in the root that redirects to the destination?

Header("Location: dynamicsubdomain.example.com/account/wel...).

The UseCanonical setting in Apache may have an effect on this, but it is defaulted to on, which preserves the host and port specified in the request. RewriteRule ^/$ /account/welcome. Html R,L.

Thanks for your support/help but I found the solution myself. Quicker than I thought :) This is what does the trick, I hope I can help someone with this: RewriteCond %{REQUEST_URI} ^/$ NC RewriteCond %{HTTP_HOST} ^(A-Za-z0-9+). Example\.

Com NC RewriteRule ^ http://%1.example.com/account/welcome.html L @gahooa: I need to do this because my mainpage example. Com is just a sort of landing-page with no special things. The extra part of the URL "account/welcome.

Html" is for showing a page related to the "subdomains"-account (gahooa.example. Com for example will show your profile page). In my app I catch up the subdomain by a preg_match so it knows witch account it has to load.

I hope I'm clear :) But thanks anyway! This is my first time i'm using Stackoverflow but it actually works great! Quick replies from experts, great work!

I definitely will come back :).

If you really want to use HTTP_HOST: RewriteRule ^$ http://%{HTTP_HOST}/account/welcome. Html L,R But like gahooa already said you don’t specify an absolute URL if you stay with the same host. The URL path will suffice: RewriteRule ^$ /account/welcome.

Html L,R.

I need to get some help with this subdomain-situation. How do I do this? I tried several things but all without result.

The main problem is that I can't fetch the entered dynamic subdomain from the %{HTTP_POST} string from mod_rewrite. Another issue would be that it's creating and endless loop. So it only needs to redirect on these conditions, not when there's a URL like http://dynamicsubdomain.example.com/test/page.html.

Because else it will create and endless loop. It's just for the starting page from the website.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions