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
Related Tags
redirect × 2269nginx × 616
apache-2.2 × 467
.htaccess × 325
https × 228
rewrite × 205
mod-rewrite × 176
301-redirect × 163
ssl × 162
apache-2.4 × 150
domain-name-system × 149
http × 129
iis × 119
subdomain × 93
domain × 86
linux × 82
virtualhost × 74
apache2 × 70
url × 62
reverse-proxy × 61
wordpress × 61
iptables × 58
proxy × 58
php × 43
redirection × 42