# A link without .html extension

**URL:** <https://forum.pinegrow.com/t/a-link-without-html-extension/8942>\
**Category:** Beginners\
**Created:** [June 3, 2024, 5:09pm UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942 "2024-06-03T17:09:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tony789](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/tony789/32/2220_2.png) [@tony789](https://forum.pinegrow.com/u/tony789)\
**Post date:** [June 3, 2024, 5:09pm UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942/1 "2024-06-03T17:09:17Z")

</div>

Hello,  
We have sent out a printed leaflet containing the link to our “join” page shown without the “.html” extension. People typing in the link to visit the page receive a 404 error.  
I could remove “.html” from the file name on the server, but that would mean changing other links that point to the full URL. Is there a way to overcome this so that both “[https://www.xxxx.xxx/join.html](https://www.xxxx.xxx/join.html)” and “[https://www.xxxx.xxx/join](https://www.xxxx.xxx/join)” will work?  
Grateful for any advice.

---

<div class="post-metadata">

**Author:** ![tony789](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/tony789/32/2220_2.png) [@tony789](https://forum.pinegrow.com/u/tony789)\
**Post date:** [June 3, 2024, 5:29pm UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942/2 "2024-06-03T17:29:00Z")

</div>

If a uploaded a duplicate of “join.html” to the server without the “.html” extensions, so that I have both "join.html” and “join” files on the server, would that work?  
Tony

---

<div class="post-metadata">

**Author:** ![Cary](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/cary/32/6029_2.png) [@Cary](https://forum.pinegrow.com/u/Cary)\
**Post date:** [June 4, 2024, 5:44am UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942/3 "2024-06-04T05:44:07Z")

</div>

You can keep “join.html” so your other links can still point to it, but also create a folder on the site called “join” and put a file, “index.html” in that folder.

index.html should have whatever is on join.html

Because it is in a folder, some image or other asset links may need to be updated.

Then I believe the browser with the incomplete address will try “[https://www.xxxx.xxx/join/](https://www.xxxx.xxx/join/)” which is the same as “[https://www.xxxx.xxx/join/index.html](https://www.xxxx.xxx/join/index.html)”.

---

<div class="post-metadata">

**Author:** ![tony789](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/tony789/32/2220_2.png) [@tony789](https://forum.pinegrow.com/u/tony789)\
**Post date:** [June 4, 2024, 11:19am UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942/4 "2024-06-04T11:19:28Z")

</div>

Thank you, that’s helpful.

---

<div class="post-metadata">

**Author:** ![oleteacher](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/oleteacher/32/1121_2.png) [@oleteacher](https://forum.pinegrow.com/u/oleteacher)\
**Post date:** [June 8, 2024, 8:58pm UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942/5 "2024-06-08T20:58:46Z")

</div>

If you’re using Apache server, this may help you or get you started. Place in your (or create) .htaccess file:

```auto
RewriteEngine On
RewriteRule ^join$ join.html [L]

```

---

<div class="post-metadata">

**Author:** ![mxs](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/mxs/32/2943_2.png) [@mxs](https://forum.pinegrow.com/u/mxs)\
**Post date:** [June 9, 2024, 3:12pm UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942/6 "2024-06-09T15:12:10Z")

</div>

To remove html file extension [https://example.com/page.html](https://example.com/page.html)  
To [https://example.com/page`](https://example.com/page%60)  
Add the following to the .htaccess file in the root directory

**`RewriteEngine On`**

**`RewriteCond %{REQUEST_FILENAME} !-d`**

**`RewriteCond %{REQUEST_FILENAME} !-f`**

**`RewriteRule ^([^\.]+)$ $1.html [NC, L]`**

---

<div class="post-metadata">

**Author:** ![AllMediaLab](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/allmedialab/32/2079_2.png) [@AllMediaLab](https://forum.pinegrow.com/u/AllMediaLab)\
**Post date:** [June 10, 2024, 1:08pm UTC](https://forum.pinegrow.com/t/a-link-without-html-extension/8942/7 "2024-06-10T13:08:15Z")

</div>

Or more simple:

```auto
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

```
