NP_LMFancierURL v3.0.2 - Search engine optimized URLs

Post your new plugins here!
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Wed Sep 14, 2011 1:01 pm

I know. But it's a functional workaround until 4.0 comes out and you have access to those new API events.
Is your question not solved yet?
Search our FAQ,
read the Documentation, or
browse the list of available plugins.

Check out my plugins
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Sat Sep 17, 2011 3:14 pm

The v2.1.1 release of the NP_LMFancierURL plugin is now available. It contains the following changes from v2.1.0:
  • Added function on the admin page to update special skin part URL parts. Because the plugin can't catch special skin parts being added to a skin or removed from a skin, must this function be used after a special skin part has been added to a skin or removed from a skin.
  • Uses Nucleus admin page notification to inform if a special skin part URL parts update is neccesary.
For a download link, upgrade documentation and the full information on the plugin see the NP_LMFancierURL plugin page or wiki page.
- Leo -
LMNucleus CMS home page: nucleus.slightlysome.net
My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com
My Nucleus plugins.
Rick69
Posts: 3
Joined: Sat Feb 25, 2012 9:03 pm

Postby Rick69 » Sat Feb 25, 2012 9:35 pm

I have installed the plugin but it does not work as it should.

When I click on a article title the url is the same as before: mydomain.com/?itemid=xx
When I click on a category the url is: mydomain.com/category/categoryname
When I first click on a category and then on a article title the url is: mydomain.com/category/categoryname?itemid=xx
When I click on the ”read more” link for extended articles the url is: mydomain.com/item/articletitle#more

So it does not work when clicking on article titles on the homepage or on a category-page. Also, I don't want the ”#more” at the end when clicking on the ”read more” links.

How do I fix this?
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Sun Feb 26, 2012 11:36 pm

Never seen this problem before.

Are you using any plugins to show the items on the index page?

What is the content of the "Item Header" and "Link to extended entry" in the template you are using for the index?

The #more is added to the url in the template. It is used to jump directly to the extended part when you go the item page. It is not handled by the NP_LMFancierURL plugin. If you don't want this behavior you can change the "Link to extended entry" part in the index template.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
Rick69
Posts: 3
Joined: Sat Feb 25, 2012 9:03 pm

Postby Rick69 » Mon Feb 27, 2012 1:36 pm

Thanks for the reply.

I have deleted "#more" from "Link to extended entry."
<p class="readmore"><a href="<%itemlink%>" title="Read more on '<%title%>'">read more >>></a></p>

Now I have clean urls (without "#more") when clicking on "read more" but still have the ugly urls when clicking on the article titles.
The "Item header" is empty in both templates and I do not use plugins to show items on index page.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Mon Feb 27, 2012 3:35 pm

In the template used to display items on the index page (maybe called something like skinname/index or skinname/short), could you post the contents of the Item Body field?
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
Rick69
Posts: 3
Joined: Sat Feb 25, 2012 9:03 pm

Postby Rick69 » Mon Feb 27, 2012 6:54 pm

I changed the skin and now it works perfect!

The skin I first used was 1024px. Also, it does not work with the ”classic-emotion” skin, but I have not tried all the skins, so maybe there are more skins it does not work with. It works well with these: Default, Andreas 01, Hotairballoons, Indexnet, Interlude, Longbeach, Shallowgrunge.


”Item body” in 1024px/index:

<h2><%date%>: <a href="?itemid=<%itemid%>" title="Read entry: <%title%>"><%title%></a></h2>

<div class="text">

<%body%>

</div>

<%morelink%>

<p class="box">

Category: <a href="<%categorylink%>" title="Category: <%Category%>"><%Category%></a> | Posted by: <a href="<%authorlink%>" title="Author: <%author%>"><%author%></a> | <%comments%>

</p>
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Mon Feb 27, 2012 8:22 pm

Code: Select all

<h2><%date%>: <a href="?itemid=<%itemid%>" title="Read entry: <%title%>"><%title%></a></h2>

This is the problem. Note that the link is generated by this: ?itemid=<%itemid%> which doesn't give the plugin a chance to rewrite it (so this skin wouldn't work with any fancy url plugin or scheme). It would work if you changed the above line to this:

Code: Select all

<h2><%date%>: <a href="<%itemlink%>" title="Read entry: <%title%>"><%title%></a></h2>
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Mon Feb 27, 2012 8:38 pm

Related to another thread, I just made a change to the installation instructions in the wiki to note that to get the correct links in the RSS feed, you need to set the $CONF['Self'] variable in xml-rss2.php in the same way that you do in index.php.
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
matt_t_hat
Posts: 1123
Joined: Sun Aug 21, 2005 4:45 pm
Location: UK
Contact:

Multi-domain support

Postby matt_t_hat » Thu Jul 19, 2012 7:08 pm

I've just installed the latest version and I am really impressed.

However I am once more doing strange things with NucleusCMS. This time I am running multi domain name on the one install. To be honest Nu mostly just copes with this. I use a simple inspection of the incoming domain name to force the blogid for that domain name and other than that it mostly just works (cookies are a pain sometimes).

To avoid having the blog name in the title I have added CONF values so that the selected blog is the default one.

The thing that I noticed is even though I have specified the domain name of blogs in the blog settings area this is not used by the plugin. 99.9999% this is probably the right thing to do.

I'd hesitate to call it a bug and lean more towards extreme hacking limit.
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Re: Multi-domain support

Postby slightlysome » Thu Jul 19, 2012 10:18 pm

matt_t_hat wrote:The thing that I noticed is even though I have specified the domain name of blogs in the blog settings area this is not used by the plugin. 99.9999% this is probably the right thing to do.

When generating a URL is the $CONF['Self'] variable used for the domain part of the URL. This is what the Nucleus core uses when generating URLs.

If you want differentiate the domain part you have to update the $CONF['Self'] variable before any URLs are generated. An other option is to modify the plugin to use the blog url setting instead of the $CONF['Self'] variable. It should be only one place that you will need to change.

When parsing the URL is only the parameter string used when parsing, the domain is never considered.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
User avatar
matt_t_hat
Posts: 1123
Joined: Sun Aug 21, 2005 4:45 pm
Location: UK
Contact:

Re: Multi-domain support

Postby matt_t_hat » Fri Jul 20, 2012 11:34 am

slightlysome wrote:When parsing the URL is only the parameter string used when parsing, the domain is never considered.
A-ha. This is good news.

I wonder if you can help me with something else related to this plugin.

To ge the exact behaviour I wanted I set the default blog based on the incoming domain like this:

Code: Select all

      include('./config.php');
      $CONF['Self'] = 'http://example.com';
      $CONF['IndexURL']=$CONF['Self'].'/';
      $CONF['AdminURL']=$CONF['Self'].'/nucleus/';
      $CONF['PluginURL']=$CONF['Self'].'/nucleus/plugins/';
      $CONF['SkinsURL']=$CONF['Self'].'/skins/';
      $CONF['ActionURL']=$CONF['Self'].'/action.php';
      $CONF['MediaURL']=$CONF['Self'].'/media/';
      $CONF['ItemURL']=$CONF['Self'];
      $CONF['ArchiveURL']=$CONF['Self'];
      $CONF['ArchiveListURL']=$CONF['Self'];
      $CONF['MemberURL']=$CONF['Self'];
      $CONF['SearchURL']=$CONF['Self'];
      $CONF['BlogURL']=$CONF['Self'];
      $CONF['CategoryURL']=$CONF['Self'];
      $CONF['AdminEmail']='admin@exmaple.com';
      $CONF['SiteName']='example blog';
      $CONF['DefaultBlog']=2;
      selectBlog('exmpl');


I have set hide blog part of url on default blog.

The problem is that the links generated throw a 404 when clicked.

Obviously I have done something that the code was not expecting but how easy might it be to get it all working? Specifically where should I be looking?
User avatar
matt_t_hat
Posts: 1123
Joined: Sun Aug 21, 2005 4:45 pm
Location: UK
Contact:

Postby matt_t_hat » Fri Jul 20, 2012 11:56 am

I've taken it upon myself to enhance the error reporting. One can now see which of the seven conditions for 404 are being triggered.

It's throwing error [1] which is where it fails the test if($usedblogurlscheme <> $blogurlscheme) with as compact <> fancier

My first question was how did compact come to get set anywhere? I updated the doerror (from the one shown in the code example at the end here) to

Code: Select all

doError('<h1>404 Not Found</h1><p>The requested URL '.serverVar('REQUEST_URI').' was not found on this server. </p><!-- DEBUG: n='.$n.'; ERROR:'.$urlerrormessage.'; -->');
It seems the error happens when the while loop continues on to a third pass (n=2) on the array but it is only a 2 part array (0,1).

Here's the enhanced debug version of event_ParseURL:

Code: Select all

   ////////////////////////////////////////////////////////////////////////
   // URL events
   function event_ParseURL(&$data)
   {
      global $itemid, $memberid, $catid, $blogid, $archivelist, $archive, $special, $CONF, $manager;      
      
      if ($data['complete']) { return; }
   
      if($data['info'])
      {
         $aParts = explode('/', trim($data['info']));
         
         $cnt = count($aParts);
         $n = 0;
         $first = true;
         $urlerror = false;
         $keyparamname = '';
         
         $showblogsinstalled = $manager->pluginInstalled('NP_ShowBlogs');
         
         $globalurlscheme = $this->getOption('globalurlscheme');
         $usedhidedefblog = 'no';
         $usedglobalurlscheme = '';
         $usedblogurlscheme = '';
         $bloglevelurl = false;
         $multipart = false;
         
         while ($n < $cnt && !$multipart)
         {
            $urlpart = $aParts[$n];
            
            if($urlpart)
            {
               if($showblogsinstalled && $urlpart == 'page')
               {
                  $n++;
               }
               else
               {
                  if($keyparamname && ((string) intval($urlpart) == (string) $urlpart))
                  {
                     if($blogid)
                     {
                        if($usedblogurlscheme)
                        {
                           if($usedblogurlscheme <> 'classic')
                           {
                              $urlerror = true;
                              $urlerrormessage = "[7] $usedblogurlscheme <> 'classic'";
                           }
                        }
                        else
                        {
                           $usedblogurlscheme = 'classic';
                        }
                     }
                     else
                     {
                        $usedglobalurlscheme = 'classic';
                     }

                     ${$keyparamname} = (int) $urlpart;

                     $keyparamname = '';
                  }
                  else
                  {
                     $aURLPart = false;

                     if($bloglevelurl == false && $blogid)
                     {
                        // Check for blog multipart url
                     
                        if($n > 0)
                        {
                           $urlmultipart = '/'.implode('/', array_slice($aParts, $n));
                        }
                        else
                        {
                           $urlmultipart = '/'.implode('/', $aParts);
                        }
                        
                        $aURLPart = $this->_getURLPartPlugin()->findURLPartForParseURL($urlmultipart, $blogid);
                        if($aURLPart === false) { return false; }
                        
                        if($aURLPart)
                        {
                           $multipart = true;
                        }
                     }
                     
                     if(!$aURLPart)
                     {
                        $aURLPart = $this->_getURLPartPlugin()->findURLPartForParseURL($urlpart, $blogid);
                        if($aURLPart === false) { return false; }
                     }
                     
                     if(!$aURLPart && $first)
                     {
                        $blogid = $CONF['DefaultBlog'];
                        
                        // Check for blog multipart url
                        if($n > 0)
                        {
                           $urlmultipart = '/'.implode('/', array_slice($aParts, $n));
                        }
                        else
                        {
                           $urlmultipart = '/'.implode('/', $aParts);
                        }
                        
                        $aURLPart = $this->_getURLPartPlugin()->findURLPartForParseURL($urlmultipart, $blogid);
                        if($aURLPart === false) { return false; }
                        
                        if($aURLPart)
                        {
                           $multipart = true;
                        }
                        else
                        {
                           $aURLPart = $this->_getURLPartPlugin()->findURLPartForParseURL($urlpart, $blogid);
                           if($aURLPart === false) { return false; }
                        }

                        $usedglobalurlscheme = $this->getOption('globalurlscheme');
                        $usedhidedefblog = 'yes';
                     }
                  
                     if($aURLPart)
                     {
                        $aURLPart = $aURLPart['0'];
                        
                        $paramname = $aURLPart['paramname'];
                        $refid = $aURLPart['refid'];
                        $urlpartname = $aURLPart['urlpartname'];
                        $uniquecode = $aURLPart['uniquecode'];
                        
                        if($uniquecode == 'B')
                        {
                           $bloglevelurl = true;
                        }
                        
                        if($paramname)
                        {
                           if($refid)
                           {
                              if($keyparamname)
                              {
                                 if($blogid)
                                 {
                                    if($usedblogurlscheme)
                                    {
                                       if($usedblogurlscheme <> 'fancier')
                                       {
                                          $urlerror = true;
                                          $urlerrormessage = "[6] $usedblogurlscheme <> 'fancier'";
                                       }
                                    }
                                    else
                                    {
                                       $usedblogurlscheme = 'fancier';
                                    }
                                 }
                                 else
                                 {
                                    $usedglobalurlscheme = 'fancier';
                                 }
                              }

                              ${$paramname} = (int) $refid;
                           }
                           else
                           {
                              if($blogid)
                              {
                                 $scheme = $this->_getBlogURLScheme($blogid);
                                 
                                 if($keyparamname == $paramname)
                                 {
                                    if($scheme == 'fancier' || $scheme == 'classic')
                                    {
                                       if($usedblogurlscheme)
                                       {
                                          if($scheme <> $usedblogurlscheme)
                                          {
                                             $urlerror = true;
                                             $urlerrormessage = "[5] $scheme <> $usedblogurlscheme";
                                          }
                                       }
                                       else
                                       {
                                          $usedblogurlscheme = $scheme;
                                       }
                                    }
                                    else
                                    {
                                       $urlerror = true;
                                       $urlerrormessage = "[4] $scheme == 'fancier' || $scheme == 'classic'";
                                    }
                                 }
                              }
                              
                              ${$paramname} = $urlpartname;
                           }

                           if(!($keyparamname == 'itemid' &&  $paramname == 'archive'))
                           {
                              $keyparamname = '';
                           }

                           if(isset($this->aParsedURL[$paramname]))
                           {
                              array_push($this->aParsedURL[$paramname],${$paramname});
                           }
                           else
                           {
                              $this->aParsedURL[$paramname] = array(${$paramname});
                           }
                        }
                        else
                        {
                           if($urlpartname == 'Archives')
                           {
                              $archivelist = $blogid;
                              $this->aParsedURL['archivelist'] = array($blogid);

                              $usedblogurlscheme = $this->_getBlogURLScheme($blogid);
                              
                              $keyparamname = '';
                           }
                           else
                           {
                              $aType = $this->_getURLPartPlugin()->findTypeByTypeName($urlpartname);
                              if($aType === false) { return false; }
                              
                              if($aType)
                              {
                                 $aType = $aType['0'];
                                 
                                 $keyparamname = $aType['paramname'];                        
                              }
                           }
                        }
                     }
                     else
                     {
                        $urlerror = true;
                        $urlerrormessage = "[3] \$aURLPart is false";
                     }
                  }
                  $first = false;
               }
            }
            $n++;
         }
         
         if(!$usedglobalurlscheme)
         {
            $usedglobalurlscheme = 'compact';
         }

         if($usedglobalurlscheme <> $globalurlscheme)
         {
            $urlerror = true;
            $urlerrormessage = "[2] $usedglobalurlscheme <> $globalurlscheme";
         }

         if($bloglevelurl && $blogid)
         {
            
            if(!$usedblogurlscheme)
            {
               $usedblogurlscheme = 'compact';
            }

            $blogurlscheme = $this->_getBlogURLScheme($blogid);

            if($usedblogurlscheme <> $blogurlscheme)
            {
               $urlerror = true;
               $urlerrormessage = "[1] $usedblogurlscheme <> $blogurlscheme";
            }
         }
         
         if($usedhidedefblog <> $this->getOption('hidedefblog') && $blogid == $CONF['DefaultBlog'])
         {
            $urlerror = true;
            $urlerrormessage = "[0] $usedhidedefblog <> OPT('hidedefblog') && $blogid == \$CONF['DefaultBlog']";
         }
         
         if($urlerror)
         {
            header("HTTP/1.0 404 Not Found");
            doError('<h1>404 Not Found</h1><p>The requested URL '.serverVar('REQUEST_URI').' was not found on this server.</p><!-- DEBUG: '.$urlerrormessage.' -->');
         }

         if($itemid && $catid)
         {
            $itemparsecat = $this->getBlogOption($blogid, 'blogitemparsecat');
            
            if($itemparsecat == 'global')
            {
               $itemparsecat = $this->getOption('globalitemparsecat');
            }
            
            if($itemparsecat == 'never')
            {
               $catid = 0;
            }
         }
      }
      else
      {
         $blogid = $CONF['DefaultBlog'];
      }

      $data['complete'] = true;
   }
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Fri Jul 20, 2012 1:19 pm

matt_t_hat wrote:It seems the error happens when the while loop continues on to a third pass (n=2) on the array but it is only a 2 part array (0,1).

The error is triggered after the loop (hence the n=2). The URL parser has identified a compact style bloglevel urlpart in the URL, but your configuration says bloglevel url parts should use the fancier style.

Why it identifies a compact style bloglevel urlpart is hard to say without any reproducible examples.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
User avatar
matt_t_hat
Posts: 1123
Joined: Sun Aug 21, 2005 4:45 pm
Location: UK
Contact:

Postby matt_t_hat » Fri Jul 20, 2012 3:57 pm

It seems I underestimated the determination of nucleus to use default default values.

I found the one event that fires before parse URL and used it to force my will onto the system. This got us unstuck from the first error but onto [0] the last possible error that can be thrown.

For some reason the script is detecting that while ('hidedefblog') == yes we are currently running as "no". This seems to be because it never gets set to yes as 'no' is the default. I'll let you know if I get any further.

EDIT: It seems on the second pass it sets first to false which means $usedhidedefblog is left as no.

EDIT: I've also updated the debug to .= the message and there are more than one erorr fail points but it seem to have gotten the itemid and blogid just fine:

[itemid] => 6
[memberid] =>
[catid] => 0
[blogid] => 2
[archivelist] =>
[archive] =>
[special] =>

EDIT:EDIT: As the itemid had been gotten even if it had not liked doing it very much I abused the if error test and it seems to work:

Code: Select all

if($urlerror && !($itemid)) {
...snip...
}


I'd love to figure out how my tampering with the rest of nucleus caused that to happen sometime.
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Sat Jul 21, 2012 3:52 pm

After sleeping on it and checking the code today it seems to be easy to implement multiple domain handling in the plugin. I actually have a proof of concept running already.

So far it seems to be the following features/limitations:
  • The nucleus installation must be in the document root.
  • Custom domain can be turned on pr blog. (uses URL configured in blog settings as custom domain)
  • You can configure if the custom domain is to be used for identifying the blog. Otherwise the blog parameter is in the URL as normal.
  • All domain used to identify blogs must be unique.
  • If a blog is identified by a domain will member pages linked from the blog use the site domain.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Sun Jul 29, 2012 1:08 pm

slightlysome wrote:So far it seems to be the following features/limitations:
  • The nucleus installation must be in the document root.
  • If a blog is identified by a domain will member pages linked from the blog use the site domain.

I have found workarounds for these limitations, and they will not be in the multiple domain handling in the next version of the plugin.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Sun Jul 29, 2012 11:37 pm

The v3.0.0 release of the NP_LMFancierURL plugin is now available. Among the news and changes in this version of the LMFancierURL plugin are:
  • Possible to set a custom base URL for each blog. This will let you host blogs with different domains on the same Nucleus installation.
  • Option to redirect to the URL of the default blog index page when a base URL is used.
  • Option to include blog in generated member links to ensure the correct skin is used on the member page.
  • Requires version 1.1.1 of the NP_LMURLParts plugin.
For a download link, upgrade documentation and the full information on the plugin see the NP_LMFancierURL plugin page or wiki page.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Mon May 20, 2013 10:28 am

The v3.0.1 version of the NP_LMFancierURL plugin has been released. The changes for this version are:
  • Should now work with PHP 5.4.
For a download link, upgrade documentation and the full information on the plugin see the NP_LMFancierURL plugin page.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
User avatar
LordMatt
Posts: 33
Joined: Wed May 01, 2013 7:46 pm

Postby LordMatt » Thu May 23, 2013 4:02 pm

I have been using this for some time now without any problem. I use a switcher to pick the right details and have a handful of different domains working fine.

The switcher works like this:

Code: Select all

<?php

global $CONF;

$FQD = $_SERVER['SERVER_NAME'];
$FQD = str_replace('www.','',$FQD);

switch($FQD){

   case 'mybigfatarse.com':
      $CONF['Self'] = 'http://mybigfatarse.com';
      $CONF['SiteName']='My Big Fat Arse';
      $blogid = 3;
      selectBlog('bigfat');
      break;
   
   [...]
   
   default:
      include "old_index.php";
      exit;
}

$CONF['DefaultBlog']=$blogid;
$CONF['IndexURL']=$CONF['Self'].'/';
$CONF['AdminURL']=$CONF['Self'].'/nucleus/';
$CONF['PluginURL']=$CONF['Self'].'/nucleus/plugins/';
$CONF['SkinsURL']=$CONF['Self'].'/skins/';
$CONF['ActionURL']=$CONF['Self'].'/action.php';
$CONF['MediaURL']=$CONF['Self'].'/media/';
$CONF['ItemURL']=$CONF['Self'];
$CONF['ArchiveURL']=$CONF['Self'];
$CONF['ArchiveListURL']=$CONF['Self'];
$CONF['MemberURL']=$CONF['Self'];
$CONF['SearchURL']=$CONF['Self'];
$CONF['BlogURL']=$CONF['Self'];
$CONF['CategoryURL']=$CONF['Self'];


Today I set up http://recommend.lordmatt.co.uk/ which is a subdomain and I did so in exactly the same way:

Code: Select all

<?php

[...]

   case 'recommend.lordmatt.co.uk':
      $CONF['Self'] = 'http://recommend.lordmatt.co.uk';
      $CONF['SiteName']='As Recommended by Matthew';
      $blogid = 7;
      selectBlog('recommend');
      break;   


The trouble is that none of the urls actually work in that they all return 404. Now I know that I run this as a cname via cloudflair but I really don't see that this could be the source of my woes (unless there was some gotcha that I missed).

I've rebuilt URLs, checked and updated everything I could think to in order to jiggle it into life but nothing.

The other blogs on the same install are all working.

Any ideas?

Edit: I updated to the latest version but the problem remains.

Edit: Checking back over some design work I did it does appear to be an issue I am having with subdomains. Still clueless as to why.

Edit: The update has broken URLs for all blogs as they no include SQL error messages

Return to “Plugin Development”