Jump to content
onjegolders

Migrated site now some pages are redirecting to homepage

Recommended Posts

Hi guys,

Have just transferred a site over to a live domain. I did the following:

Exported old db,

Created a new db on new server

Transferred files and folders to new domain

Changed db details in config.php

Imported db to new db

The site is up and all looks fine but some (at least half) of my pages are just redirecting to the homepage.

I'm scratching my head here, do any of you have any ideas where this may be coming from?

Thanks.

PS Just to add that the old site was on a subfolder ie: .com/folder, now I'm at the root level

Not sure if this makes a difference

Share this post


Link to post
Share on other sites

Did you maybe develop in a subdirectory and transfer to a root directory? Or did your dev site use absolute instead of relative local urls? I guess in both cases the "redirect to home" would in fact be a 404, which would only happen if your template/site doesn't provide a 404 page.

Share this post


Link to post
Share on other sites

Is it possible that you have forgot to also transfer the .htaccess file? Cause it seems that apache rewrite engine isn't working to me. Sometimes the .htaccess file is hidden.

If it is there you could try and set

RewriteBase /

(look it up in .htaccess file).

Share this post


Link to post
Share on other sites

Hi, thanks both of you.

Yes it was previously in a subfolder of a different domain and now it is at root level of the new domain. Pretty sure I don't have any absolute urls but will check again.

Some pages eg: /news are displaying fine while others eg: /about are showing the homepage (I should point out that the address in the address bar correctly displays /about).

I have my .htaccess file in the root and for rewritebase I see:

# RewriteBase /

# RewriteBase /pw/

# RewriteBase /~user/

Does that look ok? Thanks again

Share this post


Link to post
Share on other sites

Also did a quick test.

If I rename the url of the page to something else, I can load the page fine so "abouts" will work fine but then when I rename back to "about", it will just show the homepage again.

Hmmm, it does sound like anything with that name gets redirected but can't see where this is coming from!

Share this post


Link to post
Share on other sites

Have you tried setting "RewriteBase /" in the .htaccess? I seem to remember this being necessary if moving from a subdirectory to root, but I'm not 100% sure about it.

Share this post


Link to post
Share on other sites

Sorry Yellowled, Sinnut alluded to this and I copied out what is already in my htaccess file:

When you say setting it, what exactly do you mean?

I already have RewriteBase/ in the file.

Share this post


Link to post
Share on other sites

You need to remove te # from the start of that rewritebase line otherwise it won't run.

If that doesn't help then try deleting everything in the site/cache folder too.

Share this post


Link to post
Share on other sites

Thanks, Pete, tried both those but to no avail sadly.

Is there any other combination for the RewriteBase apart from the standard one I should be considering?

Share this post


Link to post
Share on other sites

The fact that /abouts/ worked and /about/ didn't makes me think this is browser cache. Can you try from another browser? Sometimes browsers get a redirect cached in there and it's hard to clear. I don't think that you should need anything for your RewriteBase--leave it commented, and try from another computer/browser to see if it does the same thing.

Another thing to check is if you have any modules installed that might get involved with redirects, like any of these: http://modules.processwire.com/categories/seo-accessibility/ ... I don't think any should cause problems, but it would be good to know if there were any other factors at play, just in case.

Share this post


Link to post
Share on other sites

Thanks Ryan, just tried it on Safari which I'd not used before for it and same story unfortunately.

The only modules I have on this install are

EmailObfuscator

HelloWorld

ManageFiles

Can't think why only some pages are like this and not others?

Could it be a database corruption?

Share this post


Link to post
Share on other sites

Doesn't sound like DB corruption, but there's no way to answer that definitively. You might try disabling those 3 modules just in case, but it seems not that likely that any of them would be interfering here. Can you PM me a link to this site so that I can try to access the URL and see what happens? I'll monitor the HTTP headers to get a little more detail about what could be happening. If you have an FTP login, this would also be helpful to get a look behind the scenes, but that's up to you.

Share this post


Link to post
Share on other sites

Doesn't sound like DB corruption, but there's no way to answer that definitively. You might try disabling those 3 modules just in case, but it seems not that likely that any of them would be interfering here. Can you PM me a link to this site so that I can try to access the URL and see what happens? I'll monitor the HTTP headers to get a little more detail about what could be happening. If you have an FTP login, this would also be helpful to get a look behind the scenes, but that's up to you.

Sorry Ryan I didn't see this reply until now! As is so often the way I ended up having to move quickly onto a new project, so will have to check back the other one as once I'm off something for a few days, I completely lose the plot as to what was wrong in the first place!

I'll PM you as soon as I figure it out, thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By dweeda
      How do I migrate a template with all its fields and values to a new site? Is their an export/import process?
    • By joeck
      Hi Guys,
      I'm trying to do my first migration to the customers existing server (IIS 10) . I ran the site as a subdirectory on my website for test purposes (everything works fine).
      Following the tutorial of Joss, I tryed the site on a local xampp server to make sure, it also works on a root directory. So far so good, everything works.
      Now I moved the files (from the xampp) to the customers server. The root/index page is shown but for every subpage i get 404 Errors...
      Hence I followed the troubleshooting guide for not working URLs:
      On the first sight, the .htaccess file is not recognized, therefore I contacted the host support. They said, it is recognized but not all modules are supported in the processwire .htaccess file. I did the "öalskjfdoal" test in the .htaccess file and didn't get a 500 Error.... BUT the rewrite rule from the hosts support, to proof the file is read, DID work... The support claims, they do not provide debugging... so basically the .htaccess file is recognized and working, but not throwing any errors (for whatever reason).
      Working rewrite rule (from support):
      RewriteEngine On RewriteBase / RewriteRule ^test\.asp$ index.html [NC,L] RewriteRule ^test\.html$ konzept.html [NC,L] RewriteRule ^test2\.html$ team.html [NC,L] The support said, a couple modules are not supported in the htaccess file, the supported ones are listed here: http://www.helicontech.com/ape/ (I think mod_rewrite is supported)
      As I do not completely understand what exactly is happening in the htaccess file, I'm stuck. I tried all suggestions I found regarding this topic on the forum, but none of them solved the problem.
       
      .htaccess.txt
    • By Maxplex
      Hey there, 
      i have a big Problem. I migrate Processwire with a Plugin from my local Mama Server to a 1&1 web server. After few Problems with Internal Error (.htaccess), the site looks greta and its work. But my Admin Panel are not working correctly. Before I installed the AdminThemeUIKit but now I can't install ist anymore and I can't refresh my modules. Nothing happens after a mouse click on it. If I am going to the pages, I can't see anything. There isn't a Site Tree or anything else. I can not change anything there. Please help me, it is a huge Problem for me... The admin looks like the very beginning of Processwire !!!


    • By Pete Jones
      Afternoon,
      I have a page setup with a repeater which has 40 or so items in. Each repeater item has around 6 fields.
      This is becoming a little unusable so I'd like to convert them to child pages of the current parent. Is there a way to do this (import/export maybe?)
      Many thanks
      Pete
    • By bora
      Hello everyone,
      Last night as a "saturday night shitty weather stay at home" project I attempted to migrate a project that was on PW 2.7.x to PW 3.x 
      I use a lot of partials on the project so I have around 200 php files that needs to be namespaced. Compiler was giving me trouble with "Call undefined function" errors.
      Being the lazy developer I attempted to wrote a script after getting bored over pasting  the namespace Processwire; line into around 10 files.
      Below you can find the script, that is very basically adds <?php namespace Processwire;?> as the first line of every .php and .module file in the given directory and shows you the results. Of course it checks for namespace Processwire first
      By default it assumes ./site/templates folder but I tried it with a module which is giving errors due to namespaces and worked fine.
      Be careful and remember to take backups first
      https://gist.github.com/borantula/e41c4b6ba36f78b1110d400a16754691
×
×
  • Create New...