Jump to content

.htaccess for root folder when "/shop" subdirectory


AdrianFilip

Recommended Posts

Hi guys,

I have a website example.com with html (e.g. homepage would be example.com/index.html).

I want to add a shop to a subdirectory of this domain (example.com/shop), where naturally the homepage would be example.com/shop/index.php.

My problem is that the homepage for the shop (example.com/shop/) returns a 403 Forbidden error page. All other pages on the PrestaShop work just fine (e.g. example.com/shop/category).

I noticed that if I remove the .htaccess file from the root directory (example.com) the page will load correctly, which leads me to believe that there is a problem with the setup of this file, and not the one generated by PrestaShop backoffice.

I have no idea how the .htaccess should be configured so that my /shop page to work.

This is how the .htaccess in my domain root folder looks like:

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

DirectoryIndex index.html

Options +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]
RewriteRule ^$ /index.html [L]


RewriteCond %{THE_REQUEST} ^GET.*index\.html [NC]
RewriteRule (.*?)index\.html/*(.*) /$1$2 [R=301,NE,L]


ErrorDocument 404 /404page.html
ErrorDocument 403 /404page.html

<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
  ExpiresActive On
  ExpiresDefault A2592000
</FilesMatch>

Any idea how to change it to get my /shop homepage working?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...