Jump to content

Recommended Posts

Hi Guys, 

I have a question in regards to SEO and Processwire. 

We are in process of migrating a site with about 600+ pages that resides on a bespoke CMS. 

About 200 of these pages are keyword targeted pages.  They are content heavy with friendly URLs.  However, these pages reside in the CMS under a section called other.  Since the CMS they are on is not Processwire but custom, the URLs are vanity URLS, whereas Processwire the URL would look like:

/other/page-title 

Therefore, I have setup a vanity url field and used a similar approach to what Soma did here:

https://processwire.com/talk/topic/3057-how-to-keep-pages-organized-when-managing-lots-of-landing-pages/

But for my solution I do show the shorter vanity url, in which some users are displaying the redirect. 

My question is this:  If I show the shorter URL, is Google going to crawl the page as:

/other/page-title 

or

/page-title

Any help is appreciated. 

Thanks guys!

Share this post


Link to post
Share on other sites

it depends on if you are rendering the page off the root or redirecting; for a landing page you may as well render it using the URL segments technique;

and you can manipulate your canonical URL to show the off-root URL

Share this post


Link to post
Share on other sites

@Macrura - To be exact, I am using the approach Soma used here:

https://processwire.com/talk/topic/3057-how-to-keep-pages-organized-when-managing-lots-of-landing-pages/

I am also enabled URL segments on the home page. 

So when the user visits the shorter url, the page displays and the url stays short. Basically what Soma did here:

if($found->id){
    echo $found->render();
    exit(0);
}

Share this post


Link to post
Share on other sites

My question is this:  If I show the shorter URL, is Google going to crawl the page as:

/other/page-title 

or

/page-title

as long as the page URL is /page-title they should crawl that;

you could also use a hook to make those pages live off the root as is explained in the CMS critic case study.

that would take care of the URLs, because then the system would always rewrite those landing page URLS to the root versions

i use this for landing pages:

wire()->addHookBefore('Page::path', function($event) {
  $page = $event->object;

  if($page->template == 'landing-page') {
    // ensure that pages with template 'landing-page' live off the root
    $event->replace = true;
    $event->return = "/$page->name/";
  }

});

in the landing page itself i put this:

// if someone tries to access this page at it's real location in the page tree, redirect to the fake URL:
if(!$input->urlSegment1) {
	$session->redirect($page->url);
}

Share this post


Link to post
Share on other sites

@Macrura, I figured it out! 

After rereading what you said about the CMSCritic Case Study, I had go back and and adjust the code of the home page with:

if(strlen($input->urlSegment2)) {
  // we only accept 1 URL segment here, so 404 if there are any more
  throw new Wire404Exception();

} else if(strlen($input->urlSegment1)) {
  // render the landing page named in urlSegment1 
  $name = $sanitizer->pageName($input->urlSegment1);
  $post = $pages->get("/landing-pages/")->child("name=$name");
  
  if($post->id) echo $post->render();
    else throw new Wire404Exception();
  

} else {

Share this post


Link to post
Share on other sites

yeah - that's the other piece of the puzzle... !

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 Mike Rockett
      Docs & Download: rockettpw/markup-sitemap
      Modules Directory: MarkupSitemap
      Composer: rockett/sitemap
      MarkupSitemap is essentially an upgrade to MarkupSitemapXML by Pete. It adds multi-language support using the built-in LanguageSupportPageNames. Where multi-language pages are available, they are added to the sitemap by means of an alternate link in that page's <url>. Support for listing images in the sitemap on a page-by-page basis and using a sitemap stylesheet are also added.
      Example when using the built-in multi-language profile:
      <url> <loc>http://domain.local/about/</loc> <lastmod>2017-08-27T16:16:32+02:00</lastmod> <xhtml:link rel="alternate" hreflang="en" href="http://domain.local/en/about/"/> <xhtml:link rel="alternate" hreflang="de" href="http://domain.local/de/uber/"/> <xhtml:link rel="alternate" hreflang="fi" href="http://domain.local/fi/tietoja/"/> </url> It also uses a locally maintained fork of a sitemap package by Matthew Davies that assists in automating the process.
      The doesn't use the same sitemap_ignore field available in MarkupSitemapXML. Rather, it renders sitemap options fields in a Page's Settings tab. One of the fields is for excluding a Page from the sitemap, and another is for excluding its children. You can assign which templates get these config fields in the module's configuration (much like you would with MarkupSEO).
      Note that the two exclusion options are mutually exclusive at this point as there may be cases where you don't want to show a parent page, but only its children. Whilst unorthodox, I'm leaving the flexibility there. (The home page cannot be excluded from the sitemap, so the applicable exclusion fields won't be available there.)
      As of December 2017, you can also exclude templates from sitemap access altogether, whilst retaining their settings if previously configured.
      Sitemap also allows you to include images for each page at the template level, and you can disable image output at the page level.
      The module allows you to set the priority on a per-page basis (it's optional and will not be included if not set).
      Lastly, a stylesheet option has also been added. You can use the default one (enabled by default), or set your own.
      Note that if the module is uninstalled, any saved data on a per-page basis is removed. The same thing happens for a specific page when it is deleted after having been trashed.
          
    • By franciccio-ITALIANO
      Hi, we can choose the "headline" and "title" and "summery" in panel page of processwire, but we can't write the "metadecriptions" and "tags".
       I can write mdescropt and tags in templates, but I've same templates for many articles... so, how I can change mdescription and tags?

      Thanks...
    • By Leftfield
      Hi All 🙂

      How to append canonical URL to head from certain templates?

      Thanks!!!
    • By Marco Angeli
      Hi there,
      I added a ssl certificate to my site and I'd like to redirect every single http url to its new https version
      So I added this code in the .htacces file, after the RewriteEngine On :
      Redirect 301 /about https://www.mysite.it/about
      Unfortunately this is now working: I get the "too many redirects" error.
      The following code works, but it's a bulk redirection to the home page, something I don't want for SEO reasons (https://moz.com/blog/save-your-website-with-redirects😞
      RewriteCond %{HTTP_HOST} mysite\.it [NC]
      RewriteCond %{SERVER_PORT} 80
      RewriteRule ^(.*)$ https://www.mysite.it/$1 [R,L]
      Any suggestions?
    • By chrizz
      hey there
      I guess a lot of you have already heard of the hreflang attribute which tells search engines which URL they should list on their result pages. For some of my projects I build this manually but now I am wondering if there's need to add this as a module to PW modules directory. 
      How do you deal with the hreflang thingy? Would you you be happy if you can use a module for this or do you have concerns that using a module maybe does not cover your current use cases?
      Cheers,
      Chris
       
       
       
       
×
×
  • Create New...