Forum Moderators: phranque
Or would it cause the destruction of the universe because I have no apparent idea what I just did?
I tried
{code as above}
but it doesn't seem to work
The original subdomain is currently pointed away from the normal server (another DNS), but will be changed back. I've done some testing on another subdomain (same DNS) to see if it works or not...and it doesn't.
Oh, ###, that makes all the difference. The htaccess has to be located where the original request will see it. That means in the subdomain's current home, wherever it may be.
Since you're capturing two things from the Rule, it would be www.example.com/$1/$2 etc. But it could perfectly well also be
([a-zA-Z0-9-]+/[0-9]+)
as a single $1 capture, since you're using both pieces in their original order.
The original subdomain is currently pointed away from the normal server
I've been placing it inside the root .htaccess of the domain, not the subdomain.
Is your dummy subdomain located in a subdirectory inside the real domain?
The pattern for the rule can match only the path part of the requested URL, not hostname nor query string.
The pattern for the rule can match only the path part of the requested URL, not hostname nor query string.
I dont understand what you mean by this?
RewriteRule ^testing.example.co.uk
The RewriteRule pattern matches only the PATH part of the requested URL.
A RewriteCond testing HTTP_HOST matches only the requested hostname.
A RewriteCond testing QUERY_STRING matches only the requested query string.
Be sure to escape all literal periods in patterns.
I'm going round in endless circles here
how do I capture the part of the URL I need for the redirect?
I thought they were the same thing, so, one wasn't needed?
RewriteCond %{HTTP_HOST} ^subdomain\.example\.co\.uk