In the .htaccess file where competition.example.com
points to on the filesystem, you can use a mod_alias Redirect
:
Redirect 301 /option_1 /option_2
This assumes you don't have any existing mod_rewrite (ie. RewriteRule
) redirects that might conflict.
Note that .htaccess files inherit along the filesystem path (regardless of whether you are using subdomains or not). So if the competition
subdomain actually points to a /competition
subdirectory off the main domain's document root, then the .htaccess file in the parent directory (the main domain's document root) will be processed second.
However, by default, mod_rewrite directives are not inherited (mod_rewrite is different to other modules in this respect). So directives in the child (subdirectory) .htaccess file will completely override the parent.
UPDATE: Since you are using mod_rewrite throughout your root .htaccess file you should change the above (mod_alias) Redirect
to use mod_rewrite as well. mod_rewrite will execute before mod_alias, regardless of the order of directives in .htaccess, so it's quite possible there is a conflict.
At the very top of your root .htaccess file (which I assume is the root of subdomain), try the following:
RewriteRule ^option_1(.*)$ /option_2$1 [R=302,L]
This assumes you don't have files that start "option_1".
Change the 302
(temporary) redirect to 301
(permanent) redirect when you are sure it's working OK. 301 redirects are cached by the browser, so can make testing problematic. For this reason you need to make sure your browser cache is emptied before testing.
competition
subdomain located on the filesystem? ...In a subdirectory calledcompetition
, off the document root? Do you have other .htaccess files already on your system?