htaccess redirects |
[eluser]ggoforth[/eluser]
hello all! I'm in the middle of trying to get a url like: my-username.mydomain.com to rewrite to: mydomain.com/my-username I have this working perfectly, but now I'm wondering if this can be done silently (instead of doing a hard redirect to the proper URL, the domain stays as my-username.mydomain.com). I'm doing the redirect via .htaccess, and again, it's working fine, now I'm just wondering how to do it without changing the URL in the browser (if it's possible). thanks to anyone that might have experience with this! Greg
[eluser]Bondie[/eluser]
I believe people relate to them as dynamic subdomains. Code: RewriteEngine On Quote:This will render abcd.yourwebsite.com into yourwebsite.com/profile.php?id=abc Hope this helps you, no idea if this works or not. Not personally tried by me, simpily Google'd. Resource: http://keyboarddance.wordpress.com/2007/...-htaccess/
[eluser]ggoforth[/eluser]
Hi Bondie, What you've got here is exactly how I'm doing it, BUT in the rewrite rule I'm using the full domain so I'm doing: RewriteRule ^(.*)$ http://www.mydomain.com/profile.php?id=%1 I wonder if doing the path (instead of a full domain) as you've outlined it here will run the redirect silently instead of showing the new URL in the address bar....gonna give it a shot. Greg
[eluser]Bondie[/eluser]
As I've said I havn't personally tried it, but heard of people using it and naming it "dynamic subdomains" so I gave it a bit of a Google and found that article, if this doesn't help sorry for wasting your time, and all the best in finding the solution, if you find a working solution, I would love to know also Good night
[eluser]ggoforth[/eluser]
[quote author="Bondie" date="1248151371"]As I've said I havn't personally tried it, but heard of people using it and naming it "dynamic subdomains" so I gave it a bit of a Google and found that article, if this doesn't help sorry for wasting your time, and all the best in finding the solution, if you find a working solution, I would love to know also Good night [/quote] Waste of time, not at all! I'm thinking you actually gave me a hint as to what I need to do. Gonna try in a few minutes. I will let you know if it works. greg
[eluser]Bondie[/eluser]
I'm off for some well deserved sleep, been a busy day, if you do find a way, I would love to know, message me? Good night from the UK |
Welcome Guest, Not a member yet? Register Sign In |