Jump to content

Cannot remove folder name from back office url


Recommended Posts

I am moving my shop to a vps server but I am having issues with the admin url. 

 

The previous installation was installed in the root and not in a folder. I am using the .htaccess redirect that is generally recommended and the shop url is working fine. (see below) The problem is that when I type www.mysite/admin it redirects to www.mysite/folderName/admin. If I use this url some of the back office  pages are  blank and nothing saves.

 

If I change it to www.mysite/admin/ which includes the trailing / it stays on the correct url and everything works ok.

 

There are a number of people who use the back office and so I would like to keep it working as it always has in the past and not have a string of complaints about the back office not working. 

 

Any suggestions? 

 

Below is the .htaccess

# 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.)?mysite.com$

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

# 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 ^(.*)$ /foldername/$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.)?mysite.com$
RewriteRule ^(/)?$ /index.php [L]
Link to comment
Share on other sites

this is probably caused by not changing the base uri, this is located in back office-->preferences-->seo and urls, basically that is where prestashop is installed.

 

as you can not access the back office you can change this using phpmyadmin

 

table: yourprefix_shop_url

 

field: physical_uri put your folder name /yourfoldername/

 

if this resolved the back office, then you will need to remove the   .htaccess rewrite as front office may not work...but it would no longer be needed.

Link to comment
Share on other sites

Thanks for that, it looks like i'm getting closer. 

 

Now the back office url is

 

mysite.com/foldername/admin

 

the back works ok and the front still works to but now the front has gained the folder name in the url.

 

mysite.com/foldername/ 

 

I may not have made it clear in my first post that the .htaccess referred to is in the root and not in the subfolder.

I cannot remove the redirect from the .htacces in the root or the website url will no longer point to the sub folder that holds the Prestashop files.

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