• Resolved ian000bell

    (@ian000bell)


    I have manually migrated my WordPress website from a development computer (i.e. localhost) to the web hosting company server using this reference as a guide. When viewed on the server, I can see my home page but all links to the other web pages do not work and I get the 404 error.

    My question is, what are the URLs supposed to look like on the production website, (given that the WordPress permalinks option is set to ‘Post Name’)? Details are provide below.

    I will use the contact page to illustrate the problem. Assume the folder/directory on my development computer where the WordPress files are located is FOLDERNAME and the actual domain name is NEW_LIVE_WORD_PRESS_SITE.COM. The WordPress permalinks is set to Post Name.

    On my development computer, all webpages can be successfully accessed/viewed. For example, the URL for the contact page is: localhost/FOLDERNAME/contact.

    To prepare the database for migration, I export it to an .SQL file and edit this file by replacing all occurrences of https://localhost/FOLDERNAME/ with https://NEW_LIVE_WORD_PRESS_SITE.COM/. I then FTP/copy the .SQL file to the server and import it into the database on the server.

    On the production website, when I try to access the contact page (e.g. using the menu) then the URL that appears in the address bar is https://www.NEW_LIVE_WORD_PRESS_SITE.COM/contact and I get the 404 error. Is this the correct format for a WordPress site?

    It seems the URLs are not correctly mapped to my web pages but I don’t have enough experience yet with WordPress to know what the mistake is that I’ve made. Thanks for all comments and suggestions.

    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by ian000bell.
    • This topic was modified 3 years, 8 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Ian,

    Did you change the Site URL? Maybe it may be still pointing to your localhost so it is giving you 404.

    Check these atricles for help.

    Moving WordPress

    Changing The Site URL

    Thanks.

    Thread Starter ian000bell

    (@ian000bell)

    Thanks Kartik. You pointed me in the right direction. My website is hosted on a windows server. This means my WordPress website must include the file ‘web.config’ with particular settings. I created this file and placed it in the main directory that contains my WordPress website.

    The contents of web.config that worked for me are as follows:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="Main Rule" stopProcessing="true">
                        <match url=".*" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php" />
                    </rule>
                </rules>
            </rewrite>
            <staticContent>
                <remove fileExtension=".svg" />
                <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
            </staticContent>
        </system.webServer>
    </configuration>

    For future reference, if it will help anyone else, here are two references:

    StackOverflow – look for answer provided by ‘charan kumar’
    You should update your web.config now WordPress Permalinks

    • This reply was modified 3 years, 8 months ago by ian000bell.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to manually migrate website from localhost to server?’ is closed to new replies.