5

will having almost 1000 redirects in the .htaccess file significantly slow performance Having 1000 separate redirect directives in .htaccess could certainly impact performance, although that may not be "significant" to the running of your site. However, you shouldn't be implementing these type of redirects (site migration, different URL structure with no ...


4

As @dan mentioned in comments, this is a regular expression ("regex" for short and often referred to as a "pattern" in Apache docs). Specifically, Apache uses the PCRE (Perl Compatible Regular Expressions) flavour of regex. The first argument to the RewriteRule directive is a regex that matches against the URL-path component of the requested URL. In ....


3

It seems it was a caching issue in this instance. Bear in mind that any 301 (permanent) redirects that may have been in place earlier or had simply been used in testing (perhaps in error), are cached persistently by browsers (and possibly intermediary caches). For this reason it can be beneficial to test with 302 (temporary) redirects until it's confirmed ...


3

When you redirect a page to the home page, Google treats that as a "Soft 404". Google sees it as equivalent to removing the page without a redirect. As such, you will lose all your rankings for that keyword. Your other options are to improve the tag page itself, or to build a special page just about that topic and redirect to it instead. If you did ...


3

If your new landing page that you're redirecting to, holds relevant information/content that adds more value to the keywords your pages are being ranked for, then you can hold your ranking positions. If your new landing page is generic and you're trying to redirect users from other landing pages, the ranking positions depend on your on-page factors as well ...


3

Servers can't deliver real objects, but URIs can represent real objects. See What is the difference between a URI and a URL? The example might be better clarified if you imagine that you published and printed a book containing information that used to be on your website. Now that you published the book, you took that information down off your website. ...


2

From the browser error you posted it looks like you don't have a valid SSL cert for the old domain. You will need to have a valid SSL cert for the old domain if you wish to redirect https://olddomain.example as otherwise, the browser won't allow the request to reach your server.


2

I just tested this out on a Firebase Hosting site and (after disabling my browser extensions) I got a 301 redirect, not a 307. What are you using to inspect the status code? Web browsers sometimes report a 307 status code when there's an internal redirect within the browser itself before it sends the request. Chrome for example calls this kind of pre-...


2

In .htaccess, to redirect all URLs that start /tourism to /Tourism then you can do something like the following at the top of the .htaccess file in the root, before the WordPress front-controller: # Redirect "/tourism" to "/Tourism" RewriteRule ^t(ourism.*) /T$1 [R=302,L] Change the 302 (temporary) redirect to 301 when you are sure it's working OK. For a ...


2

For anyone who may have stumbled on this as I did in seeking out an answer to the same question, I'm going to guess you're hosted at WPengine. If that's the case, simply login and open up a chat with support and tell them to turn off: redirect bots I wrote about the cause of the issue in a post here but if you're not interested in the full story, it ends ...


2

To change a sub-domain, I use the ServerAlias and a condition against the HTTP_HOST. For example, I generally wanted to have "", "w", "ww", "wwww" redirect to "www". I do this using the following type of rules: ServerName www.example.com ServerAlias example.com w.example.com ww.example.com wwww.example.com RewriteEngine On RewriteCond %{HTTP_HOST} ^(...


2

Another simpler method is to use redirects from mod_alias. A similar redirect directive from mod_alias is just one line. It doesn't require turning rewrite engine on. The syntax is pretty clear: Redirect permanent / https://www.example.com/ That means redirect the root of the website and all sub-URLs to the other website. Any additional path is ...


2

I assume you are already linking to the URL of the form: /subfolder/page1/. In which case, you can do something like the following using mod_rewrite near the top of your .htaccess file in the root of your site: RewriteEngine On RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^(subfolder/[^/]+)\.html$ /$1/ [R=302,L] The RewriteCond directive that checks ...


2

It's unclear to me what your use case is, but here is a solution to your question as it's worded. You can use HSTS preloading to ensure that all modern browsers always connect using HTTPS, without the need for a 301 redirect (though keeping a 301 redirect active is recommended). Note that to be eligible for HSTS preload list inclusion, you must do one of ...


2

yes you should make this redirection. Meta canonical isn't enough in that case because it won't prevent your page to be indexed by Google. Canonical are used for pages that aimed to be indexed without hurting canonical url seo.


2

A 301 redirect and Canonical links are two fundamentally different concepts. A canonical URL should be set up if you have two pages of similar content on your website or if you have content on your site that is also used on another site. You can use a canonical tag to point Google to the original content and make sure the first piece gets all of the credit ...


2

When you use a 301 (permanent) redirect, the browser caches this redirection and uses it further on. So the change won't be visible for people that have already visited the URL before since they are going to be redirected to the HTTP version that you used in the first place. New visitors will follow the new redirection. However, a best practice is to force ...


2

Thanks for the responses. There was another redirect I didn't know about, for www to no www, set up in the hosting provider (OVH) control panel. And the /www redirect has stopped all of a sudden so may have been a cached redirect after all.


2

or the one under /public_html/tlf/ In the /tlf/.htaccess file add the following mod_rewrite directives at the top to redirect any requests to the /tlf subdirectory via the main domain to the subdomain's root directory: RewriteEngine On RewriteCond %{HTTP_HOST} ^gl\.example [NC] RewriteRule (.*) https://tlf.example/$1 [R=301,L]


2

Assuming you're using the URL Rewrite Module, you can use the following set of rewrite rules in the web.config: <system.webServer> <rewrite> <rules> <rule name="ForceToExample.com" stopProcessing="true"> <!-- Match any path --> <match url="(.*)" /> <conditions> <!-- ...


2

Redirect 301 /page/page-a/ /page/page-b/ [R,L] On Apache this would have resulted in a 500 Internal Server Error because the [R,L] argument is not valid on a mod_alias Redirect directive. [R,L] are RewriteRule (mod_rewrite) flags. or it displays www.example.com/page/page-b/?type=page&id=page-a This is the result of a conflict between mod_alias (...


2

You basically just need to remove the /de/.htaccess file altogether!*1 Your root .htaccess already performs the necessary redirects. (*1 Or remove all the directives and keep the ErrorDocument directive if you need a separate language-specific 404 file. But see the note below regarding the format of the ErrorDocument directive.) The RewriteRule ^index\....


2

Lets take these on one at a time. Q: What happens if an old domain redirecting to a new domain expires? A: The old domain ceases to exist at all. Q: Will it still redirect? A: No. The domain no longer exists. Q: What is the effect on search engine ranking? A: That depends. For example, if there are a number of links to the old domain, these links will ...


2

I've been apprised that the DNS entries above won't work because you can't CNAME a naked domain to a subdomain. Is that correct? Yes, as stated in comments, you can't create a CNAME record on the domain apex, ie. example.com. Trying to do so can cause problems later. You would typically do this the other way round. For example: example.com. A 14400 ...


1

303 was intended to be used when a user sends a GET request to a POST url. In other words, let's say you are POSTING to a URL using a PHP command such as $_POST. A user then tries to visit that URL, but that URL isn't supposed to provide a webpage, it's only used for POST. You can then redirect them away from the POST URL with a 303 to a URL that will ...


1

For categories I did the same: Redirect 301 /index.php?c=1 https://www.example.com/cat_slug/ I'm not sure whether you are implying these redirects work OK? But this cannot possibly work... you can't match the query string with a the Redirect directive. You need to use mod_rewrite and a condition that checks against the QUERY_STRING server variable. For ...


1

Well, that depends on the type of redirect... There are two types of redirects, ones that are handled by the server (header response) and those handled by the users browser. Header Redirects Header redirects are handled by the server and therefore no information other than the instruction to forward the user from one location to another is passed - in ...


1

From the research that I did on this years ago, I found that the only reliable method of country detection is through IP address. There are giant databases that list all of the IPs of various countries, though I found obtaining one of these databases to be very difficult at the time. If you were able to get a database of all of the IP addresses in the UK, ...


1

The identification is based on the IP of the visitor. There are many IP lists out there that link the IP of the visitor to the country they are coming from.


1

Well you can redirect www.animal.example website to that example.com/whatever by using js (JavaScript) Or PHP too. It will not affect anything regarding to SEO (Search engine optimization) JavaScript: <script>windows.location = "https://example.com/whatever"; </script> PHP: <?php header(" Location: https://example.com/whatever"); ?>


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