Jump to content

In desperate need of some htaccess help


Recommended Posts

I have a static website using server side includes residing in the /public_html directory. I am using the htaccess in that directory to do a domain redirect and to set the DirectoryIndex to look for .shtml first. Here is the htaccess in that directory:

 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
RewriteRule ^/?$ "http\:\/\/www\.domain\.com\/" [R=301,L]
DirectoryIndex index.shtml index.html index.htm

 

I have PrestaShop installed in /public_html/shop and a subdomain set up in cPanel (shop.domain.com) with that directory set as it's root. Here is the htaccess I have in the /public_html/shop folder:

 

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^shop.domain.com$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
</IfModule>
#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

 

My problem is that the htaccess in the PrestaShop directory appears to be completely ignored. It is using the DirectoryIndex from the htaccess in the parent folder, so when I load the store I just get a directory indexing since index.shtml/html/htm doesn't exist.

 

How do I get it to ignore the htaccess in the parent directory and apply the one in it's own directory? I have been reading through post after post for the last couple hours and have gotten no where.

Edited by sscardefield (see edit history)
Link to comment
Share on other sites

Not sure what the htaccess in the parent directory does. Is it useful at all to be there? (Maybe check with your host)

If not, maybe try to rename it for a moment and see if your own htaccess is used instead or not, and if other errors occur when renaming it.

 

My 2 cents,

pascal.

Link to comment
Share on other sites

Thanks for the response. As noted in my original post the htaccess in the parent directory is doing a domain redirect and telling apache to look for .shtml files by default. Both of these are necessary for the website that is running in /public_html.

 

If I rename/delete the htaccess in the parent directory everything works as expected. That is why I just need to know how to get the prestashop website to ignore the htaccess in the parent directory and use the one in it's own directory.

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...