Forum Moderators: phranque
I'm trying to redirect (302), from a subdomain to a dynamic page.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.domain\.com?$
RewriteRule ^$ /variable.php?ID=$555 [L]
And I've tried this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain.domain.com$
RewriteRule ^(.*)$ [subdomain.domain.com...] [R=301,L]
Any ideas on where I'm going wrong?
Do you have other working RewriteRules in this file?
Did you completely flush your browser cache before testing after adding and/or changing the code?
What URL did you test?
What were the results?
How did those results differ from what you expected?
Do you wish to rewrite all pages in the subdomain, or just the 'index' page?
Do you want a redirect (changes the browser address bar) or an internal rewrite (which does not)?
Jim
1. There arent any other rewrite rules I can see in the httpd.conf. Just redirects.
2. Yes
3/4. I tested the subdomain, but it just went to the default website index.html. So it looked like it was redirecting like this: go to subdomain.domain.com redirects to subdomain.domain.com/index.html?ContentType=frontpage& etc. This is the same as when you go to www.domain.com, it redirects to www.domain.com/index.html?ContentType=frontpage& etc.
5. I want subdomain.domain.com to go to subdomain.domain.com/variable.php?ID=$555
6. Just the index page.
7. I believe I want a redirect (change the address bar), so I dont know if I've gone down the wrong path...