Switch site to new domain

Many thanks for the help Craig,
I’ve been on the host company and they have fixed the issue and the website now loads.
The problem I have now is that everything I click on (categories or products) I get this error

Not Found

The requested URL /personalise-ceramic-mug-glitter-cartoonme-6.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Cool.

Are you saying the Homepage works but the links don’t? If so, go through these 7 steps:

  1. find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento
    
  2. rm -rf pub/static/adminhtml pub/static/frontend
    
  3. bin/magento setup:di:compile
    
  4. bin/magento setup:static-content:deploy en_GB en_US
    
  5. bin/magento cache:flush
    
  6. bin/magento indexer:reindex
    
  7. bin/magento cache:clear
    

**Replace en_GB and en_US in Step 3 with your appropriate languages.

Any one of those steps might solve your issue, but you may as well run them all in order just to cover your bases.

Cron Tasks
One thing that I never covered in the Tutorial is setting up Cron Tasks on the new server that you migrate to. Run this as well. I’ve updated the supporting post.

php bin/magento cron:install

Ok.
ran all those commands but still getting the error.
When I go to the original site the homepage loads and when I click on a link I get the same error but I noticed that the URL reverts to the new domain.

The new website URL in question is www.thegiftedfox.co.uk

Are you moving sites or creating a development environment (copy)? If you’re just creating a copy then your original site should be be effect because you’ve not done anything to it.

Did you update the 2 values of the Database in copied version after migrating it?

Did you definitely add the “/” at the end of the URL when you changed it in the database?

slash_after

Yes I changed the 2 base URL’s to the new domain name.
web/unsecure/base_url http://thegiftedfox.co.uk/
web/secure/base_url https://thegiftedfox.co.uk/

I did manage to get in to admin panel briefly and the base URL’s in there were still the old test one’s but I’ve checked the database and it definitely says the new.

Here is what I did.

Designed a website using WWW.thegiftedfoxtest.co.uk on a hosted server following your brilliant tutorial. I already had a live website on WWW.thegiftedfox.co.uk.
Once I had created the website and everything was working I wanted to close down my live website and move the newly created Magento site on to www.thegiftedfox.co.uk
I created a new account in cPanel using the www.thegiftedfox.co.uk domain
I then copied the entire contents of public_html from the test domain to the live domain.
Then exported the database from the test domain and imported it in to the new domain. and changed the base URL’s in the new database. Also added database credentials to app/etc/env.php.
The name servers were changed in GoDaddy for the domain www.thegiftedfox.co.uk to use the new site.

I have disabled maintenance mode on the two sites so you can have a look at the problem
Sorry for all the fuss but I hope someone else learns from my issues

Ok, gotcha. I’m just looking at the site now… I’ve seen this before!

You don’t have Apache setup correctly. You see, you can load all of your URLs so long as you put in “index.php” after the domain:

http://thegiftedfox.co.uk/index.php/personalised-cartoonme-marble-latte-mug.html

Do you have mod rewrite enabled on this server environment? You would normally set this by running sudo a2enmod rewrite but you might have to get your Web Host to set this as your in a Shared Environment and probably don’t have the premissions.

What directory do I need to be in to run this command.
I’m getting -bash: a2enmod: command not found

It’s a server command, so any. You just need to have superuser or root privileges on the user that you execute the command as.

I’m logged in as root.
I’ll have to log a ticket with the web hosts

On a side note… I like your site. There’s something to be said for a boxed-layout. My monitors run on a resolution of 1440x2560, so sites that take up the whole screen make my eyes explode. Another thing that I love you haven’t done (unless you plan to) is:

  1. Throw intrusive pop ups in the viewers face
  2. Have one of those annoying widgets that popup every-so-often with “Bill just bought xyz”

Your colour scheme is also really easy on the eye!

My only 2 pieces of constructive criticism (if you don’t mind me saying) are:

  • Product specifications should stand out more (e.g. dimensions). Whether you put them in their own paragraph or make them bold, it just makes it easier to scan for that type of stuff.
  • Displaying Delivery/Returns links somewhere “above the fold” on product pages. I’ve found this to increase consumer confidence when shopping on sites they’re never been on before.

Thanks for the advice. We thought of adding a new tab on the product page for specifications so they stand out.
We had an extension built for the CartoonMe category so customers can design their own cartoon. When they purchase we get an SVG file in the admin panel backend which we download and then print straight on to the product.
We did want to move the elements that are under the product designer to the 3rd column under the related products


but the designers wanted too much money. I’ve tried myself but couldn’t get it to work. Maybe that could be the topic for a future video?

1 Like

You can take a lot of the credit as this was built using your tutorial video

1 Like

Also, you seem to have the same annoying bug as I did. Where when you open a Product Image in fullscreen view (via fotorama), the image appears half way down the monitor until you close and open it again.

I think I solved this by removing position: absolute from the gallery.css file in the child theme.

.fotorama--fullscreen .fotorama__stage__frame .fotorama__img,
.fotorama--fullscreen .fotorama__stage__frame .fotorama__img--full {
  bottom: 0;
  left: 0;
  margin: auto;
  max-height: inherit;
  max-width: inherit;
  position: absolute; <!-- REMOVE THIS LINE -->
  right: 0;
  top: 0;
}

Excellent. That is annoying. I’ll look at using your fix
Thank you

You’ll definitely want to play around with this to see what works best. My personality likes things clean and compartmentalised. But annoyingly, at the last company I worked for we spent a lot of time A/B Testing. And the study showed (at least in our case) that viewers never clicked on the Tabs. So when ended up just having everything loaded in Open Accordions. Which hurt my brain and eyes, but I guess it’s not all about what I “like” but what “works”.

I didn’t even realise it did that. That’s awesome!

I see what you’re getting at. Looking at it in a smaller window you can’t really fit everything on the page. Just thinking out loud, but maybe have the whole thing open in some sort of lightbox? That way you’d take advantage of a standard 16:9 monitor?

Anyway… I should really get back to work. Let me know how you get on with the “index.php” issue.

I will,

Thanks Craig

All fixed.
After a lot of “Google-ing”
mod rewrite was already enabled.

I had to add the following code to the .htaccess in public_html

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>

Did that and all the links worked.
I can now also access the admin panel.

Thanks again for your help Craig

1 Like

Awesome :+1: Albeit, a little strange. Anyway, enjoy the rest of your day

A post was split to a new topic: How to change from the IP address to a regular domain