<p>Okay. I found the solution If anyone runs into the same issue.
This must be a server problem which I can't solve so there is a <a href="https://stackoverflow.com/questions/5730092/how-to-remove-html-from-url">htaccess solution</a> to remove the .html extension:</p>

<pre><code>RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
</code></pre>

CC BY-SA 3.0
2015-01-06T14:07:56.133Z
2015-01-06T14:07:56.133Z
2017-05-23T12:38:53.957Z
KSPR
<p>I just realized that my page is also accessible when there is a .html extension on the url.</p>

<p>The url would be:
<a href="http://musikwerkluzern.ch/programm" rel="nofollow noreferrer">http://musikwerkluzern.ch/programm</a></p>

<p>but <a href="http://musikwerkluzern.ch/programm.html" rel="nofollow noreferrer">http://musikwerkluzern.ch/programm.html</a> works as well but some tags are not being rendered with the html extension attached.</p>

<p>And for some reason the google search results link to the page with .html attached.</p>

<p><img src="https://i.sstatic.net/Cwqhy.png" alt="enter image description here"></p>

<p>That's bad. How can I prevent this? Is this a <code>.htaccess</code> thing?</p>

CC BY-SA 3.0
2015-01-06T07:07:21.567Z
After further examination I conclude it must be a server thing because other Craft sites I've made on other servers don't have this behaviour.
KSPR
<url><seo>
url with .html extension
# url with .html extension

(Asked by: username_0 on 2015-01-05)

I just realized that my page is also accessible when there is a .html extension on the url.

The url would be:
<http://musikwerkluzern.ch/programm>

but <http://musikwerkluzern.ch/programm.html> works as well but some tags are not being rendered with the html extension attached.

And for some reason the google search results link to the page with .html attached.

![enter image description here](https://i.sstatic.net/Cwqhy.png)

That's bad. How can I prevent this? Is this a `.htaccess` thing?

**Tags:** url, seo
> **Comments:**
> **username_0**: After further examination I conclude it must be a server thing because other Craft sites I've made on other servers don't have this behaviour.  

---

## 1 answers

### Answer by username_0 on 2015-01-06. Score: 2 | Accepted answer

Okay. I found the solution If anyone runs into the same issue.
This must be a server problem which I can't solve so there is a htaccess solution to remove the .html extension:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301]


---

