New user config http://localhost/dashboard/ navigation erro

Problems with the Windows version of XAMPP, questions, comments, and anything related.

New user config http://localhost/dashboard/ navigation erro

Postby RobMcP » 24. January 2017 20:34

Hi,

Any suggestions for a new user?

I've managed to configure and run XAMPP nicely. Apache runs nicely, Mysql runs too (after a fight with the Skype port)

Next part of the process was to copy a live site and DB to run on my local machine.

There's where my problems started. All the instructions I found were really helpful in setting up Xampp, but somewhere along the line I have missed something, or (more likely) inexperience has let me down.

My local site has 30 odd pages,

When I open a browser and go to localhost/my-staging I see the 'Home' page of the local site, and all the content displaying correctly, but when I click on any of the menu links I am sent to this page

http://localhost/dashboard/ and all I see is a screen with Welcome to XAMPP for Windows 5.5.38 etc.

Why am I not getting the result I expected, in that the local site navigation should take me to localhost/about-us or other links/pages?

I CAN log in to the wp-admin page of this local site ok. I just cannot see pages other than the Home page.

I have run a find replace module on plugins to change all urls to localhost/my-staging but this has not helped.

Can anyone offer any suggestions as to how I can get this working as I need it to?

It was all going swimmingly too :-(

Thanks in advance, McP.
RobMcP
 
Posts: 11
Joined: 24. January 2017 20:19
XAMPP version: 3.2.2
Operating System: Win 7 64 bit

Re: New user config http://localhost/dashboard/ navigation

Postby Altrea » 25. January 2017 01:29

Hi,

RobMcP wrote:Why am I not getting the result I expected, in that the local site navigation should take me to localhost/about-us or other links/pages?

Because your links are getting wrongly generated. They are pointing to http://localhost/index.php and that is wrong. It has to be http://localhost/my-staging/index.php
This can be something like a base url setting of your application, a .htaccess or something similar.
This is a very common third party webapplication issue, not a XAMPP issue.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: New user config http://localhost/dashboard/ navigation

Postby RobMcP » 25. January 2017 10:26

Sorry, need some clarification.

Because your links are getting wrongly generated. They are pointing to http://localhost/index.php and that is wrong. It has to be http://localhost/my-staging/index.php


If I view the local site in a browser and hover over any link / menu item, then it IS shown as e.g. localhost/my-staging/about-us. It does NOT show as http://localhost/index.php

Again inexperience on my part but I don't see how a link can show correctly on hover and not go to it.

Could you explain why that is happening
Sorry if these are basic questions but as mentioned XAMPP is new to me.
Thanks. McP.
RobMcP
 
Posts: 11
Joined: 24. January 2017 20:19
XAMPP version: 3.2.2
Operating System: Win 7 64 bit

Re: New user config http://localhost/dashboard/ navigation

Postby Altrea » 25. January 2017 11:28

RobMcP wrote:If I view the local site in a browser and hover over any link / menu item, then it IS shown as e.g. localhost/my-staging/about-us. It does NOT show as http://localhost/index.php

There are multiple ways how a system can react on such an url. For example it can be a physical existing folder containing an index file (e.g. C:\xampp\htdocs\my-staging\about-us\index.php).

Or, what i assume in your case, your system rewrites the url to for example generate "clean urls" => https://moz.com/learn/seo/url.
If this is the case than there needs to be a .htaccess file or Apache configuration defining how to react with that urls.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: New user config http://localhost/dashboard/ navigation

Postby RobMcP » 25. January 2017 11:45

Thanks for the (fast) update.

My problem is that having not enough experience of this I can only follow instructions that I find. This being one site.

h t t p s premium.wpmudev.org/blog/move-wordpress-xampp/

Following those instructions and others from that site allowed me to load XAMPP and configure ok, then load a site DB, and associated files, but not to have the whole site running locally, just the Home page and wp-admin page.

Checking the .htaccess file for it I see this
edited slightly as I don't know what this could will look like in a forum.

<If Module mod_rewrite . c>
RewriteEngine On
RewriteBase /my-staging
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=W3TC_ENC:_gzip]
RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
RewriteRule .* - [E=W3TC_PREVIEW:_preview]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond "%{DOCUMENT_ROOT}C:/xampp/htdocs/my-staging/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
RewriteRule .* "C:/xampp/htdocs/my-staging/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]

</IfModule>
RobMcP
 
Posts: 11
Joined: 24. January 2017 20:19
XAMPP version: 3.2.2
Operating System: Win 7 64 bit

Re: New user config http://localhost/dashboard/ navigation

Postby Altrea » 25. January 2017 16:51

Okay, the .htaccess is looking good i think.
You are using wordpress. Wordpress uses a base_url to generate the URLs. You need to check if this base_url is correct or not.
=> https://codex.wordpress.org/Changing_The_Site_URL
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: New user config http://localhost/dashboard/ navigation

Postby RobMcP » 25. January 2017 18:50

Thanks Altrea,

I did find that link previously. I have tried the

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

The sort of worked in that in Settings > General it put the values for my local site in there and 'locked' the fields so I could not manually change them. Not a problem but I removed them and did it through the control admin anyway.

I have also tried the functions.php suggestion

As below Still only see the Home and admin pages ok, any other link still goes to the wrong page.

"<?php
update_option( 'siteurl', 'http://localhost/my-staging\' );
update_option( 'home', 'http://localhost/my-staging' );
?>
(hope the above syntax is ok)

Any other suggestions out there gratefully tried - still banging my head against the wall. Frustrating...

Cheers.
RobMcP
 
Posts: 11
Joined: 24. January 2017 20:19
XAMPP version: 3.2.2
Operating System: Win 7 64 bit

Re: New user config http://localhost/dashboard/ navigation

Postby RobMcP » 25. January 2017 19:14

Thanks for your patience Altrea,

I've now got the local version up and running.
It was either the functions.php change OR I fiddled with the Permalinks settings.

McP.
RobMcP
 
Posts: 11
Joined: 24. January 2017 20:19
XAMPP version: 3.2.2
Operating System: Win 7 64 bit


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 102 guests