How to import Prestashop live to Wampserver? - wamp

I want to do some templating on my website, so I'm trying to backup my online Prestashop to my computer with Wampserver.
My website is running on Prestashop 1.6.1.7
This is what I done :
Export sql database
Download FTP files
Create a new database and import my DB with PHPMyAdmin (Wampserver 3.2.3)
Add VirtualHost in Documents/Test Add www files in /Documents/Test
Change ps_shop_url :
domain:localhost
domain_ssl:localhost
physical_uri:http://localhost/test/
Change rules in /Documents/Test/config/settings.inc.php file :
define('_DB_SERVER_', 'localhost:3306');
define('_DB_NAME_', 'mydbname');
define('_DB_USER_', 'root');
define('_DB_PASSWD_', '');
define('_DB_PREFIX_', 'ps_');
define('_MYSQL_ENGINE_', 'InnoDB');
define('_PS_CACHING_SYSTEM_', 'CacheMemcache');
define('_PS_CACHE_ENABLED_', '0');
define('_COOKIE_KEY_', 'I didn't touch it');
define('_COOKIE_IV_', 'I didn't touch it');
define('_PS_CREATION_DATE_', 'I didn't touch it');
define('_PS_VERSION_', '1.6.1.7');
define('_RIJNDAEL_KEY_', 'I didn't touch it');
define('_RIJNDAEL_IV_', 'I didn't touch it');
define('_PS_DIRECTORY_', '/../../');
But http://localhost/test/ returns a 404 not found :(
Can you help me please ?

Try to remove .htaccess int the root.
and do not rewrite url in local, so desactivate it in SQL

physical_uri should be only the path after the base URL,
so in your case just use /test/
If you are still facing issues after that, go in backoffice and regenerate .htaccess by saving in SEO&URL section.

Hello #Melvita and #user3256843
I can login tu back office and saves URL rules.
Now, all URL are live.
Just a little "problem", my local website is very looong to load and some CSS rules seems to be broken.
But all pages are 90% identical as live website.
Thank you very much folks !

Related

URLs of Azure Static Website should work without trailing /

I've created an Azure Static Website which works based on the Azure Blob Storage.
To be able to manage the automatic redirect from HTTP to HTTPs I created Azure CDN with Azure Verizon Premium subscription and I created an endpoint which
points to the URL of the static website. I followed the steps from this tutorial
If you hit the URL e.g.
https://blah.com/foo/
You will be automatically redirected to
https://blah.com/foo/index.html
This is because I set the Index document name to index.html in the Static website configuration panel.
What I want to achieve is to add the /index.html symbol to the very end of URL if it doesn't have an extension e.g.
https://blah.com/foo
https://blah.com/bar/foo
The expected result would be a redirect to:
https://blah.com/foo/index.html
https://blah.com/bar/foo/index.html
So my idea was to open the https://cdn.windowsazure.com/http/rules/default.aspx and try to create a new Rule; feature-> URL Redirect. In the TextBox near the Source label, I tried to specify the condition using Regex expression ^[^.]+$ which checks if the path contains a . If yes then it would mean the URL points to file with extension and the /index.html should be added to the end of URL. I think my Regex expression is wrong and should be different. Or maybe it is not the best way to achieve what I want?
Any ideas?
Cheers
So I tried almost everything and in the end, after adding this rule the Azure Static Webiste worked as expected:
Just further to this as I know it has an accepted answer but you won't need any redirect rule for index.html if you use a custom origin and use the static website's primary endpoint (will be something like .z8.web.core.windows.net/). For whatever reason, the CDN will treat that as a web server rather than a vanilla storage place.

Sent out broken link in a Mailchimp campaign - how to do a bulk redirect?

Just joined but have been a lurker for a while and found this community very helpful.
I've just sent out an email newsletter via Mailchimp to our 15,000 subscribers and included the wrong link (it should have been .../grandchallenges not .../grand-challenges. I've done a simple redirect on our website, but Mailchimp inserts individual URLs, so folks end up with a link that looks like this: .../grand-challenges/?mc_cid=debb7846d7&mc_eid=18de3e5c2a. As such i'd have to do 15,000 individual redirect requests, unless there's a way to 'bulk' redirect everything after the slash.
Btw - we're using Mezzanine as a Django CMS not Wordpress: http://mezzanine.jupo.org, so the answer won't be a WP plug-in.
Thanks!
use .htaccess
RewriteEngine On
RewriteRule ^grand-challenges\/(.*)$ http://example.com/grandchallenges/$1
you can check it here: htacces Tester
The .htacess file on the server can redirect anything. Add the line:
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html
See this post from hosting company, media temple for an example. Your hosting company should have specific instructions.
https://mediatemple.net/community/products/grid/204643080/how-do-i-redirect-my-site-using-a-htaccess-file
Accessing htacess can be done via FTP. I recommend FileZilla which is free and open source. https://filezilla-project.org/
See this article for additional info on htacess.
https://httpd.apache.org/docs/2.4/howto/htaccess.html
I'm not entirely sure what the question is here. Django doesn't take the querystring into account when you set up URLs, so your redirect view will work for everyone. All you then need to do is to pass on whatever query arguments you received.
from urllib.parse import urlencode
def redirect_everyone(request):
return redirect('/grandchallenges?' + urlencode(request.GET))

Redirects for Ember app on shared hosting (hostgator)

I have an ember app that I have been building. It has several routes including index (/) and authorization (/authorization). My trouble is that when the application is hosted on hostgator, loading the url myapp.com/authorization results in a 404. This makes sense since there is nothing at that actual url. I need hostgator to redirect all non-file-specific urls to my index.html file.
An example in psuedo code:
if url has extension (.jpg, .pdf, etc)
serve requested url
else
serve index.html but retain url in the address bar
I've done this sort of thing with local instances of node when using AngularJs with ui-router, but this is my first time using History-API based routing served from HostGator.
Any suggestions on where to start to set this up?
Not much of an answer but you can use locationType: 'hash' in environment.js as your configuration.
With locationType set to 'auto', refreshing on application hosted on Hostgator will produce a 404. I have encountered this before and not found any solution. So I switched to 'hash'.
If you find any solution, please tell me. Thanks!

lighttpd mod_rewrite to remote URLs for certain file extentions

I am trying to set up a local development lighttpd server with all the PHP, HTML and CSS files of my project. I want to set up lighttpd to load these files locally, but for any other file extension, load remotely on a remote website via a URL.
I have tried the following code in the lighttpd.conf file:
url.rewrite = ( "^(.*)$" => "http://<remote site>/" )
and I have also tried
url.rewrite = ( "^(.*)$" => "http://<remote site>/$1" )
This was a test for redirecting everything, however both of these return a 404 for any URL I try, so something is wrong already and is stopping me going any further.
Can someone give me some help with this?
Probably the option you're looking for is redirects via mod_redirect written as url.redirect.
This will tell the browser to go to the new url for the resource. This does slow things down slightly as the browser has to make a second request to go to the actual location of the resource.

Microsoft Azure appending extra query string to urls with query strings

In deploying a version of the Django website I'm working on to Microsoft's Azure service, I added a page which takes a query string like
http://<my_site_name>.azurewebsites.net/security/user/?username=<some_username>&password=<some_password>
However, I was getting 404 responses to this URL. So I turned on Django's Debug flag and the page I get returned said:
Page not found (404)
Request Method: GET
Request URL: http://<my_site_name>.azurewebsites.net/security/user/?username=<some_username>&password=<some_password>?username=<some_username>&password=<some_password>
Using the `URLconf` defined in `<my_project_name>.urls`, Django tried these URL patterns, in this order:
^$
^security/ ^user/$
^account/
^admin/
^api/
The current URL, `security/user/?username=<some_username>&password=<some_password>`, didn't match any of these.
So it seems to be appending the query string onto the end of the url that already has the same query string. I have the site running on my local machine and on an iis server on my internal network which I'm using for staging before pushing to Azure. Neither of these site deployments do this, so this seems to be something specific to Azure.
Is there something I need to set in the Azure website management interface to prevent it from modifying URLs with query strings? Is there something I'm doing wrong with regards to using query strings with Azure?
In speaking to the providers of wfastcgi.py they told me it may be an issue with wfastcgi.py that is causing this problem. While they look into it they gave me a work around that fixes the issue.
Download the latest copy of wfastcgi.py from http://pytools.codeplex.com/releases
In that file find this part of the code:
if 'HTTP_X_ORIGINAL_URL' in record.params:
# We've been re-written for shared FastCGI hosting, send the original URL as the PATH_INFO.
record.params['PATH_INFO'] = record.params['HTTP_X_ORIGINAL_URL']
And add right below it (still part of the if block):
# PATH_INFO is not supposed to include the query parameters, so remove them
record.params['PATH_INFO'] = record.params['PATH_INFO'].split('?')[0]
Then, upload/deploy this modified file to the Azure site (either use the ftp to put it somewhere or add it to your site deployment. I'm deploying it so that if I need to modify it further its versioned and backed up.
In the Azure management page for the site, go to the site's configure page and change the handler mapping to point to the modified wfastcgi.py file and save the configuration.
i.e. my handler used to be the default D:\python27\scripts\wfastcgi.py. Since I deployed my modified file, the handler path is now: D:\home\site\wwwroot\wfastcgi.py
I also restarted the site, but you may not have to.
This modified script should now strip the query string from PATH_INFO, and urls with query strings should work. I'll be using this until I hear from the wfastcgi.py devs that the default wfastcgi.py file in the Python27 install has been fixed/replaced.