Redirect wordpress site to www from non www on wordpress server

Unfortunately on wordpress.com hosted sites, the www is automatically removed. For self-hosted wordpress installs, there are several ways to do this. In .htaccess file using something like: Options +FollowSymlinks RewriteCond %{HTTP_HOST} !^(www\.|$) [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] or set values for WordPress address and Site address in the WordPress Admin Dashboard: Settings > General or … Read more

how to redirect 404 to attachment.php?

Try something like the following at the top of your .htaccess file, before the WordPress front-controller: RewriteRule (.+/)amp$ /$1 [R,L] This redirects a request for /<something>/amp to /<something/ – removing the “amp” suffix. Note that this is a 302 (temporary) redirect.