WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] After moving to server, links to pages doesn't work (5 posts)

  1. Meiji
    Member
    Posted 8 months ago #

    Hello everyone!

    I have a problem after uploading a client site from localhost (ip) to a Windows Server. Since it's a windows server, I did it manually:

    1) Created a data base in server
    2) Exported my localhost database from phpmyadmin, and then imported it from server to the data base created
    3) Uploaded WordPress, theme and everything via FTP
    4) Updated links (http://172.132.something.something/net-channel) to real site (http://net-channel.tv)

    It partially works, I had to adjust some other stuff again, like placing the header, background and primary menu again. The site shows, I can see the home site, I can see images, etc. Problem is, links to pages and posts doesn't work and they show 404 error.

    They don't event work from wp-admin. I mean, all pages and posts appear in admin, but when I click on preview it also shows 404.

    Am I missing something? Any help is gladly appreciated!

    The site:
    http://net-channel.tv

  2. Meiji
    Member
    Posted 8 months ago #

    The step 4 I did it in the data base using this code:

    SELECT * from wp_options where option_value like '%172.132.something.something%';

    And then I manually change them to net-channel.tv

  3. kespinoza
    Member
    Posted 8 months ago #

    I've run into this problem before and resaved the permalinks options and that resolved it.

    Something I've done is make a copy of the sql file and then do a find/replace of the url and links before importing.

  4. Meiji
    Member
    Posted 8 months ago #

    Thank you kespinoza! Since my client has it on a Windows Server, the common solutions doesn't work. But I could find out the solution and I'm posting it here in case someone else has the (unpleasant) chance to work with a Windows Server (first would be advicing the client to migrate to a Linux Server :P).

    Windows Servers use a file called 'web.config', so, all I did was create it, like this:

    <?xml version="1.0"?>
    <configuration>
    <system.webServer>
    <defaultDocument>
    <files>
    <remove value="index.php" />
    <add value="index.php" />
    </files>
    </defaultDocument>
    <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/{R:0}" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    This solves the problem I was having, however, it's highly adviced to migrate to a Linux Server, since configuration problems with some plugins persist. I'm advicing the client to migrate, hope they agree. :P

    Cheers!!

  5. hossamabdelmajeed
    Member
    Posted 4 months ago #

    Thanks Meiji
    actually I have similar problem now, (after uploading DB, WP with Themes 'n plugins - everything works fine but themes didn't take any action, it seems like it does not have a CSS file or image folder )
    So, I'm thinking of trying your method but I don't know where to put that file called "web.config".
    thanks again

Reply

You must log in to post.

About this Topic