• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Hide .html extension in the browser

Community Beginner ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

Good day everyone!

  How do you actually hide the .html extension from getting showed in the browser? I have seen that most of the websites have a professional look. Their pages are rendering without the .html or .php extensions. Can you do this in muse? Or you need to do it using a classic way. I actually found a method to do this. I added this code in the .htaccess file :

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^([^\.]+)$ $1.php [NC,L]

After this, I had to change all the links inside the html. Eg: if it linked to index/photos/photos.html , I changed the link to index/photos/ and it worked.

   The question is: is there a way to do this directly with muse, without having to manually change all the links?

  Thank you!

Views

923

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Sep 22, 2017 Sep 22, 2017

Hey,

Unfortunately, there isn't any direct way to deal with this.

The modification in .htaccess is the only way.

have a look at this tutorial - http://alexcican.com/post/how-to-remove-php-html-htm-extensions-with-htaccess maybe it has any simpler way of executing the code.

Regards,

Ankush

Votes

Translate

Translate
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

Hey,

Unfortunately, there isn't any direct way to deal with this.

The modification in .htaccess is the only way.

have a look at this tutorial - http://alexcican.com/post/how-to-remove-php-html-htm-extensions-with-htaccess maybe it has any simpler way of executing the code.

Regards,

Ankush

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

LATEST

Thank you very much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines