htaccess 301 redirect /%C2%A0/ - .htaccess

I am trying to do a 301 redirect via htaccess from http://www.domainname.co.uk/%C2%A0/ to http://www.domainname.co.uk/ but i can not get it to work
I am having a lot of trouble with the /%C2%A0/ any help with this would be great
thanks

Try:
RewriteEngine On
RewriteRule ^\xC2\xA0/?$ / [L,R=301]
Or if you have to use mod_alias:
RedirectMatch 301 ^/\xC2\xA0/?$ /

Related

How to Redirect every link beginning with the same word in .htaccess?

I need to redirect a lot of urls beginning with the same word to a new link.
Exemple:
Redirect 301 /old-text-1/ /new-link/
Redirect 301 /old-text-2/ /new-link/
Redirect 301 /old-text-3/ /new-link/
Redirect 301 /old-text-4/ /new-link/
Redirect 301 /old-text-5/ /new-link/
...
Can I redirect all this links in a better way?
I tried:
RewriteRule ^/old-text(.*)$ /new-link/ [R=301,L]
but it doesn't work.
You need to remove the trailing slash when using RewriteRule directive in .htaccess context.
RewriteRule ^old-text(.*)$ /new-link/ [R=301,L]

Redirecting subfolders and keeping the same /forum and url $1 after

I need to redirect 3 subfolders from
https://www.website.com/forums/forum-group/forum/directing-subfolder-information-example
to
https://www.website.com/forum/directing-subfolder-information-example <-- this is what I want
I tried
RedirectMatch 301 forums/forum-group/forum(.*) forum/$1
but it puts /forum/forum
Any ideas on how to do it?
This should be working
RedirectMatch 301 ^forums/forum-group/forum/(.*)$ /forum/$1
If you want to do it using mod_rewrite
RewriteEngine On
RewriteRule ^forums/forum-group/forum/(.*)$ /forum/$1 [R=301,L]

yet another htaccess redirect request - old domain to new domain and old pages to new pages

Spent a day reading through hundreds of variations all over the web but still can't find a definitive answer that works for this.
Moving old site structure on old domain to new site structure on new domain so I am looking for the best, search engine friendly, redirect code that:
permanently redirects all old-domain.com and www.old-domain.com traffic to www.new-domain.com.
Adds specific redirects from old-domain.com/old-page.html and www.old-domain.com/old-page.html to www.new-domain.com/new-page/
Here's what I have - and it isn't working - can someone improve/fix this for me please. Many thanks!
RewriteEngine on
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]
redirect 301 /old-index.html http://www.new-domain.com/
redirect 301 /old-page-1.html http://www.new-domain.com/new-1/
redirect 301 /old-page-2.html http://www.new-domain.com/new-2/
redirect 301 /old-page-3.html http://www.new-domain.com/new-3/
You should stick with using only mod_rewrite or mod_alias and not mix the two. And order matters
mod_alias:
Redirect 301 /old-index.html http://www.new-domain.com/
Redirect 301 /old-page-1.html http://www.new-domain.com/new-1/
Redirect 301 /old-page-2.html http://www.new-domain.com/new-2/
Redirect 301 /old-page-3.html http://www.new-domain.com/new-3/
Redirect 301 / http://www.new-domain.com/
mod_rewrite:
RewriteEngine on
RewriteRule ^old-index.html$ http://www.new-domain.com/ [R=301,L]
RewriteRule ^old-page-1.html$ http://www.new-domain.com/new-1/ [R=301,L]
RewriteRule ^old-page-2.html$ http://www.new-domain.com/new-2/ [R=301,L]
RewriteRule ^old-page-3.html$ http://www.new-domain.com/new-3/ [R=301,L]
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]

redirect using htaccess

I have this location
http://somesite.com/pot_system.shtml
and i want to redirect to
http://somesite.com/build_me_today
I want to do this via htaccess is that possible
I used
Redirect /pot_system.shtml http://somesite.com/build_me_today
Simplest way:
Redirect /pot_system.shtml /build_me_today
Using a 301 redirect:
Redirect 301 /pot_system.shtml /build_me_today
#Matt:
Options +FollowSymLinks
RewriteEngine on
RewriteRule /pot_system.shtml http://somesite.com/build_me_today [R=301,L]

htaccess 301 redirect rule

I'm looking for help with making a 301 redirect for:
www.domain.com/word/* to www.domain.com/*
RewriteEngine On
RewriteRule ^/?word/(.*) http://sitename.com/$1
Redirect 301 /word /

Resources