Okay so if I'm wanting to remove the extension of a URL but my canonical tags point to the url with the extension I can't use a 301 redirect without it negatively affecting SEO.
Does the same go for a url rewrite? Or can I use rewrite without it negatively affecting SEO? From what I found, a rewrite seems to only change the url in the url bar.
Assuming that this is correct, if someone were to copy the URL, would they copy the rewritten URL or would they copy the original?
Before you downvote the question for potentially not being a programming question, understand that I only asked it here because I am assuming that programmers know how htaccess works more than webmasters.
Let's break this down a bit.
Redirects
The main purpose of a redirect is to let something (in this case the search engine) know that a URL has moved to a new one. Because of this, search engines know to transfer the "SEO score" from the old URL to the new one.
For example, if you created a 301 (permanent) redirect from http://www.example.com?type=product&id=250 to http://www.example.com/products/250 the search engine will transfer the "SEO score" from the original URL to the new one.
Rewrites
The main purpose of a rewrite is to make URLs "cleaner" so that they are easier for people to type. As for SEO purposes, they can "help" with the SEO score (mostly because it makes the URL cleaner), but the search engines will not transfer the SEO score from the old URL to the new. Technically, this is because rewrites happen on the server-side (or behind the scenes) which means rewrite rules are not shared with the outside world (including search engines).
For example, if you create a rewrite rule for http://www.example.com?type=product&id=250 to be rewritten as http://www.example.com/products/250 then the search engines will have no knowledge of you trying to transfer the "SEO score" of the original URL to the new one. In fact, the only thing this will really do is make the URL easier for people to type and you'll maybe receive an SEO benefit for making the URL cleaner.
The Canonical Tag
If you are updating URLs and want to "transfer" the SEO score to the new URL, then a redirect must be used. It will not negatively affect your SEO score. However, using a rewrite will.
Summary: Use redirects when you're changing the URL of a web page and want to "transfer" the SEO score from the old URL to the new one. Use rewrites to make the URL easier to type for humans and maybe receive an increased SEO score because of the cleaner URL.