Error in the call to the pages of my local website

Hi all,

I have a problem that I can not solve alone.

After having made the backup of my Website files (public_html directory content) and MySQL database (phpMyAdmin), I installed the local version of my website with XAMPP in a directory of my PC at C:/xampp/htdocs/SiteName.

When opening the local website, calling the different pages, the error “404-Page not found” appears because instead of calling the page with the correct address http://localhost/SiteName/PageName the page is searched for in the wrong address http://localhost/PageName.

I assume that if, from a certain object of a page of my local website, I call a page with the syntax “/PageName” this should be interpreted as “http://localhost/SiteName/PageName” and not as “http://localhost/PageName” (which is instead generating the error): is it correct?

In the WP Dashboard on SEO -> Tools -> Edit File I modified the .htaccess file as follows:

BEGIN WordPress

RewriteEngine On
RewriteBase / SiteName /
RewriteRule ^ index \ .php $ - [L]
RewriteCond% {REQUEST_FILENAME}! -F
RewriteCond% {REQUEST_FILENAME}! -D
RewriteRule. / SiteName /index.php [L]

END WordPress

Furthermore the URL set in Wordpress General Settings is:
WordPress address (URL): http://localhost/SiteName
Site address (URL): http://localhost/SiteName.

Where am I doing wrong?

Thanks in advance for the help I hope you will provide me.

Best regards, Alessandra.

Hey Alessandra,

Thanks for writing in! Have you updated your database URLs? I’d suggest you to follow this article https://codex.wordpress.org/Moving_WordPress#Changing_Your_Domain_Name_and_URLs

Hope this helps!

Hi Nabeel,

thanks for the reply.

I read the page you indicated to me and I did the whole procedure correctly, except that, instead of using one of the 4 methods indicated by you, I made search and replace on my entire database to change the URLs.

In any case, the problem is that it is interpreted as home of the website “http: // localhost” instead of “http: // localhost / SiteName”: do you really think the problem may be due to the fact that I didn’t change the URLs following one of the 4 methods you describe? Do I have to repeat the whole procedure following one of the methods that you indicate?

Thanks and best regards, Alessandra.

Hi There,

Please login to your phpMyadmin, under wp_options table, please make sure the siteurl and home are correct:

And there is no spacing in your htaccess file:

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

# END WordPress

Let us know how it goes!

Hi,

I had already checked he wp_options table from phpMyadmin and it’s okay:

The .htaccess file, without spaces, like the one you attached to me in your reply, generates a blocking error that no longer allows me to access the site locally (even the Administrator Dashboard).

I am attaching the images in private mode.

Thanks, Alessandra.

Hi Allessandra,

Regretfully, this particular issue is outside the scope of our support as this is not related to an issue with the theme and instead has to do with setting your site up locally. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself. If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries.

You might want to check the link below


Thank you for your understanding.

All right, thanks to you.

You’re most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.