Highlighted

Hide .html extension in the browser

Community Beginner ,
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!

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

Views

720

Likes

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

Hide .html extension in the browser

Community Beginner ,
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!

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

Views

721

Likes

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
Sep 22, 2017 0
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

Likes

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
Reply
Loading...
Sep 22, 2017 0
Community Beginner ,
Sep 22, 2017

Copy link to clipboard

Copied

Thank you very much!

Likes

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
Reply
Loading...
Sep 22, 2017 0