Tag Info

Hot answers tagged

3

RewriteRule ^login$ /login.php? [L,R=301] You need to remove the ? on the end of the RewriteRule substitution. This is effectively creating an empty query string, removing anything that is passed in the request. RewriteRule ^login$ /login.php [L,R=301]


2

Try this: RewriteCond %{REQUEST_URI} !^/mygooglefile.txt$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] Of course you will need to change the file name and the target domain name.


1

The canonical link type is not supported by all user agents, and even if a user agent supports the canonical link type, it may decide to ignore it, so users would end up on the "wrong" URL. So a 301 redirect is preferable. This is also the recommendation of the canonical RFC: Before adding the canonical link relation, verification of the following is ...


1

redirect 301 http://m.somesite.com/site/somesite/faqs http://www.somesite.com/faqs/ This doesn't work because the source URL needs to be a URL-path, starting with a slash (as you have used for the redirects that work), not an absolute URL. In other words, it should be written as the following (in a .htaccess file located at the subdomains document ...


1

You're probably right that search engines could have trouble identifying the right pages if the sitemap can't be edited, so only the old URLs will be listed there, not the new ones. If you can add new pages & create redirects, then this might be your best solution: Create your new pages Redirect (301) to them from the old URLs Create a new sitemap ...


1

You're thinking right. Use 301 redirects from the old pages to the new pages. I'd recommend advertising only the new URLs in your sitemap that point to actual webpages with content people can see. It is not necessary to advertise the old URLs since Google automatically follows redirects. Eventually, Google will only index the new URLs and remove the old ...


1

Using .htaccess You do this with a simple .htaccess rule by detecting the browsers Accept-Language (read here). RewriteEngine on RewriteCond %{HTTP:Accept-language} ^en-GB [NC] RewriteRule ^$ https://example.co.uk [L,R=301] Using PHP You can do this with a programming language to perform a lookup (I generally use a 3rd party open API) then send the 301 ...


1

Your best option is probably to verify using DNS. This will work no matter what sort of redirects you have in place. It also doesn't require you to keep up with any special redirect rules. According to Google's help page, you should: On the Search Console Home page, click the Manage Site button next to the site you want, and then click Verify this ...



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