5 votes

.htaccess - Redirect all URLs with one exception

As mod_alias is recommended for simple redirects, here's the solution with mod_alias: # Specific redirects: Redirect 301 /old-prefix https://www.example.com/ Redirect 301 /another-old-prefix/ https://...
  • 44.5k
4 votes
Accepted

.htaccess - Redirect all URLs with one exception

You are mixing mod_rewrite (RewriteCond, RewriteRule) and mod_alias (Redirect, RedirectMatch). The stray mod_rewrite RewriteCond directive will not do anything here. This directive only applies to the ...
  • 12k
1 vote
Accepted

htaccess: 301 redirect defined URLs to new domain and catch all redirect the rest

Redirect is a mod_alias directive (nothing to do with RewriteEngine). RewriteRule belongs to mod_rewrite. mod_rewrite is always processed first, despite the apparent order of the directives in the ...
  • 12k

Only top scored, non community-wiki answers of a minimum length are eligible