Is it possible for people to access a webpage without having to write .html at the end?

Status
Not open for further replies.

tstonly

Member
Messages
53
Reaction score
0
Points
6
I copy pasted that to .htaccess but it didnt do anything....do i change the name or something.
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Try:

Code:
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI}.html -f
RewriteRule ^(.*)$ $1.html

The reason the one you have in your .htaccess doesn't work is because it tells the script to NOT work if the requested file is a file or directory.. this one only does it if the file exists.
 

tstonly

Member
Messages
53
Reaction score
0
Points
6
I should just have to copy paste it and not change the html page names to without .html right?
 

tstonly

Member
Messages
53
Reaction score
0
Points
6
When i pasted and tried to submit your code it said in a message
"Could not open /home/tstonly/public_html/.htaccess for writing: Permission denied"

Signed out then signed back in and still didnt work...
Actually its not letting me edit anything at all on that page. When i try to submit it just gives me that error. Every other page works.

Screenshot below
 

Attachments

  • Untitled.png
    Untitled.png
    21.8 KB · Views: 6
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Yeah that's my fault. one second.
Should be fine now.
 

motesx10

New Member
Messages
10
Reaction score
0
Points
1
How about creating a folder named "submit" and put an "index.html" file in it. This should work... example.com/address/submit
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
How about creating a folder named "submit" and put an "index.html" file in it. This should work... example.com/address/submit

That's not the ideal solution. An htaccess redirect is the fix for this.
 
Status
Not open for further replies.
Top