Jump to content

I got 404 page if I use "www". .htaccess ok


Recommended Posts

I have prestashop instalation in a subfolder.
I used the bottom htaccess solution that seems to work for many users.But in my site redirections is like this:

htt p : / /  mydomain.com  works: redirects to root/subfolder/index.php

htt p : / /  mydomain.com/en  works

htt p : / /  www. mydomain.com/   shows 404page: http://mydomain.com/index.php?

htt p : / /  www. mydomain.com/en  shows 404page: http://mydomain.com/index.php?controller=404

 

I am trying to figure out why using www redirects to /index.php? and index.php?controller=404
 

Htaccess file used:

# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.

# Do not change this line – RewriteEngine on
RewriteEngine on

# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?maindomainname.com$

# Change ‘subfolder’ to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/subfoldername/

# Don’t change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Change ‘subfolder’ to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /subfoldername/$1

# Change yourdomain.com to be your main domain again.
# Change ‘subfolder’ to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?maindomainname.com$
RewriteRule ^(/)?$ subfoldername/index.php [L]

-Friendly URL is activated

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

  • 1 month later...

 

I have prestashop instalation in a subfolder.

I used the bottom htaccess solution that seems to work for many users.But in my site redirections is like this:

htt p : / /  mydomain.com  works: redirects to root/subfolder/index.php

htt p : / /  mydomain.com/en  works

htt p : / /  www. mydomain.com/   shows 404page: http://mydomain.com/index.php?

htt p : / /  www. mydomain.com/en  shows 404page: http://mydomain.com/index.php?controller=404

 

I am trying to figure out why using www redirects to /index.php? and index.php?controller=404

 

Htaccess file used:

# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.

# Do not change this line – RewriteEngine on
RewriteEngine on

# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?maindomainname.com$

# Change ‘subfolder’ to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/subfoldername/

# Don’t change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Change ‘subfolder’ to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /subfoldername/$1

# Change yourdomain.com to be your main domain again.
# Change ‘subfolder’ to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?maindomainname.com$
RewriteRule ^(/)?$ subfoldername/index.php [L]

-Friendly URL is activated

 

 

 

Hello, I have exactly the same issue, with www I obtain always 404 pages but I steel see my shop (with www) and can navigate on it, but if I put a product in the cart and I click order the card is empty, also I can't register or login...

 

I would like to know if you have solved this issue. I've readed all topics about this, a lot of people have this problem.

 

Can you share the solution please? :)

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