• dangyen

    (@dangyen)


    Hi,
    Recently I found that I can’t access the file links without .html
    The full file path like this:
    domain/folder1/folder2/folder3/file.html

    How can I access with just domain/folder1/folder2/folder3/file?

    I tried following from this post, however it didn’t work.

    My .htaccess

    Thanks you!
    RewriteRule ^([^/]+)/$ $1.html
    RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html
    RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3.html
    RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3/$4.html

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\[a-zA-Z0-9]{1,5}|/)$
    RewriteRule (.*)$ /$1/ [R=301,L]
    • This topic was modified 3 months ago by dangyen.
Viewing 1 replies (of 1 total)
  • threadi

    (@threadi)

    Delete the htaccess file and then go to Settings > Permalinks in the WordPress backend. Save these once. This will cause WordPress to rewrite the htaccess file and you should receive URLs that correspond to the settings there – without this ending.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.