jpm
jpm

Reputation: 1083

How to open a webpage in a site without appending html ?

I want to open a webpage in web-browser

www.somesite.com/myPage.html

I've created myPage.html by myself, plain html

I want to open this page via

www.somesite.com/myPage

I've placed myPage.html in public_html folder in my cpanel

Upvotes: 1

Views: 65

Answers (1)

Leandro Papasidero
Leandro Papasidero

Reputation: 3738

Option1

Keep your file myPage.html in public_html

you need to create a .htaccess in public_html and add this into the file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

Option 2

  1. Make a folder calls myPage
  2. Rename file myPage.html to index.html
  3. Movethe file index.html to myPage folder

Note:- Don't use both methods at once. Remove all the data from .htacess file before using Option 2

Upvotes: 1

Related Questions