• Hello

    I created a folder named portfolio under public_html in CPanel. This folder contain my works which are some static htmls. It works exactly what I wished – I created subfolders with the work’s name and upload the html to the corresponding subfolder. (e.g. https://www.mydomain.com/portfolio/work1)

    To avoid visitors peeking my portfolio folder’s directory, I added -Options Indexes to my .htaccess.

    Recently, I wanted to expand my website a bit more by creating a page called portfolio (https://www.mydomain.com/portfolio/), but I received 403 error every time I tried to edit with Elementor, despite I already created the page with url slug (/portfolio).

Viewing 5 replies - 1 through 5 (of 5 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hi @7tmymt14,

    The error 403 represents – forbidden error means that?your browser isn’t able to load the scripts up because your server isn’t allowing it.?

    Check Permissions:

    • Ensure that the folder permissions for your portfolio directory are correctly set. The web server should have read and execute permissions for the folder and its contents.
    • Verify that the?.htaccess?file in your portfolio directory doesn’t restrict access to the page.

      Hope this helps! ??
    Thread Starter 7tmymt14

    (@7tmymt14)

    Hello!

    Thank you for answering my question.

    Read and execute permissions are already set for portfolio folder.

    I only edited the .htaccess file in public_html. There’s no .htaccess file in my portfolio. When I removed -Options Indexes from .htaccess, entering domain.com/portfolio will show the directory instead of page. I am able to edit the page but the page just won’t show.

    Regards.

    • This reply was modified 1 year, 3 months ago by 7tmymt14.

    There’s no .htaccess file in my portfolio. When I removed -Options Indexes from .htaccess, entering domain.com/portfolio will show the directory instead of page. I am able to edit the page but the page just won’t show.

    That’s the expected behaviour: as long as a physical file or directory exists on the file system with the same path/URL, it takes precedence over WordPress’ virtual URLs (permalinks).

    That’s why you’re seeing the directory index (or 403 when directory indexing is disabled).

    Thread Starter 7tmymt14

    (@7tmymt14)

    Hi George

    Thank you for replying.

    Is there a way to show the WP page instead of the directory? Do I have to create a page with a different permalink?

    Regards,

    Moderator bcworkz

    (@bcworkz)

    Either use a different permalink or different folder name. Physical files and folders cannot have the same names as those in permalinks. These rules in .htaccess prevent WP from being used if a physical folder or file exists for the request:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    !-f means file does not exist, similar for !-d and directories

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘FTP folders and WP pages’ is closed to new replies.