Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> nukeSEO
Author Message
jane65
Regular
Regular


Joined: Feb 24, 2009
Posts: 81
Location: UK

PostPosted: Mon Sep 23, 2013 9:17 am Reply with quote

Hi,
Please can someone advise me on how I can make my URLS seo friendly for Content and News, instead of showing something like - /modules.php?name=Content&pa=showpage&pid etc. as my urls.

I've looked through the forums, but the info out there just seems a bit confusing to me, so I still don't understand what I need to do.

Thanks in advance for any help with this Smile
 
View user's profile Send private message
wHiTeHaT
Life Cycles Becoming CPU Cycles


Joined: Jul 18, 2004
Posts: 576
Location: Netherlands

PostPosted: Mon Sep 23, 2013 12:38 pm Reply with quote

Open rnconfig.php
Find:

Code:


$tnsl_bUseShortLinks   = false;  // Setting this to "true" will cause RavenNuke(tm) to shorten the URLs in GoogleTap/GTNG fashion.
$tnsl_bAutoTapBlocks   = false;  // Setting this to "true" will cause RavenNuke(tm) to shorten the URLs automatically for block files.


change to:

Code:


$tnsl_bUseShortLinks   = true;  // Setting this to "true" will cause RavenNuke(tm) to shorten the URLs in GoogleTap/GTNG fashion.
$tnsl_bAutoTapBlocks   = true;  // Setting this to "true" will cause RavenNuke(tm) to shorten the URLs automatically for block files.
 
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jane65
PostPosted: Mon Sep 23, 2013 3:49 pm Reply with quote

Hi, thanks for your reply Please can you tell me if the shortened URLs are meant to display when I go to a page on site, or whether the shortened URL's will just show on the search engine results? The reason I ask is because I tried a few pages on my site after making the change but my urls are still the same and showing /modules.php?name etc.
 
jane65
PostPosted: Mon Sep 23, 2013 3:58 pm Reply with quote

Hi, thanks for your reply Please can you tell me if the shortened URLs are meant to display when I go to a page on site, or whether the shortened URL's will just show on the search engine results? The reason I ask is because I tried a few pages on my site after making the change but my urls are still the same and showing /modules.php?name etc.
 
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Mon Sep 23, 2013 4:19 pm Reply with quote

You also have to copy the contents of the ShortLinks.htaccess to your .htaccess in the specified location.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
jane65
PostPosted: Mon Sep 23, 2013 6:17 pm Reply with quote

Hi, do you mean copy the shortlinks.htaccess to the main site .htaccess file or do you mean add an .htaccess file to a specific module? Its just that when I copied it to the .htaccess file where it said to put it, it didn't work as I got an internal error on my site. Thanks for your help Smile
 
nuken
PostPosted: Mon Sep 23, 2013 6:26 pm Reply with quote

You should copy the ShortLinks.htaccess content from
Code:
RewriteEngine on
down

and paste it directly after
Code:


<IfModule mod_rewrite.c>
   # TegoNuke(tm) ShortLinks - ShortLinks.htaccess file/rules should go after this line

in your .htaccess

It should work
 
jane65
PostPosted: Mon Sep 23, 2013 6:40 pm Reply with quote

Hi, the error message has gone since I decided to add
RewriteEngine on
RewriteRule ^index.html index.php
RewriteRule ^index.htm index.php
and the Content plus module rules only. Before I just copied the whole file and pasted it, hence the error message.

Can you just confirm if the shortened URL should show in my address bar after doing this, because if its meant to, it still isn't showing a shortened URL.

Thank you Smile
 
nuken
PostPosted: Mon Sep 23, 2013 7:09 pm Reply with quote

I have never tried to use it with only 1 modules rules. I have only used it with all the rules added and yes, it should show in the address bar unless you are using a third party menu block that would need an additional tap file for it.
 
jane65
PostPosted: Tue Sep 24, 2013 5:57 am Reply with quote

Hi, Since I put all the rules in, I have found that the legal pages do show the shortened URLS, its just the content ones that aren't showing, so it is probably something I have done that stops it working because my content module has been modified and so has the jquery/nukenav.php which produces the links that I am clicking to go to the pages of the content module.
Is it possible to create new rules as by writing the actual links to my pages and then writing the shortened URL it should be known by? There isn't that many pages, so just wondering if I could get around the problem by doing something like that.

Thank you Smile
 
jane65
PostPosted: Tue Sep 24, 2013 6:22 am Reply with quote

Hi again, I just looked at the jquery/nukenav.php, and took out the / before modules.php? on all the links there, and now I am getting a shortened link but its just showing - /content-4.html, /content-7.html etc. after site name for each page, its not actually changing it to a proper title. Any suggestions of how I can correct this? If I remember rightly (it was some time ago) I added code to the nukenav.php, so it would produce a link to each page of a specific category of the content module.

Here's typical code that I have for a content module category in nukenav.php.

Code:
if (is_active('Content')) {

   $nukeNAV .= '
<li><a href="modules.php?name=Content&amp;pa=list_pages_categories&amp;cid=2" title="">Teach Yourself</a>';
   $NAVresult = $db->sql_query('SELECT * FROM '.$prefix.'_pages pages WHERE active=\'1\' AND cid=2');
   $NAVnumrows = $db->sql_numrows($NAVresult);
      if ($NAVnumrows > 0) {
      $nukeNAV .= '
     <ul>';
      while ($XXrow = $db->sql_fetchrow($NAVresult)) {
      $XXpid = $XXrow['pid'];
      $XXtitle = $XXrow['title'];
      // display cat
      $nukeNAV .= '
   <li><a href="modules.php?name=Content&amp;pa=showpage&amp;pid='.$XXpid.'" title="">'.$XXtitle.'</a>';
   // content for cat
   $NAVresult2 = $db->sql_query('SELECT * FROM '.$prefix.'_pages WHERE active=\'1\' AND pid=\''.$XXpid.'\'');
       if ($NAVnumrows2 > 0) {
      $nukeNAV .= '
     <ul>';
      while ($XXrow2 = $db->sql_fetchrow($NAVresult2)) {
      $XXpid = $XXrow2['pid'];
      $XXtitle2 = $XXrow2['title'];
      $nukeNAV .= '
   <li><a href="modules.php?name=Content&amp;pa=showpage&amp;pid='.$XXpid.'" title="">'.$XXtitle2.'</a></li>';
      }
      $nukeNAV .= '
     </ul>
   </li>';
      }else{
      $nukeNAV .= '</li>';
      }
}
   if (is_user($user)) $nukeNAV .= '
  <li><a href="modules.php?name=Content&amp;pa=add_page" title=""></a></li>';
   $nukeNAV .= '
  </ul>
</li>';
   }else{
   $nukeNAV .= '</li>';
   }
}
 
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1692
Location: Texas, USA

PostPosted: Tue Sep 24, 2013 8:08 am Reply with quote

you shouldn't have to edit nukeNAV. Does your site url in admin/preferences have a trailing slash on it? It shouldn't.
Good Only registered users can see links on this board! Get registered or login!
Bad Only registered users can see links on this board! Get registered or login!
(my apologies as we really need to be validating that in the form)

Are you expecting the title of the story in the URL? It can be done, but it does not have that feature by default (requires modifications).
 
View user's profile Send private message Visit poster's website
jane65
PostPosted: Tue Sep 24, 2013 12:40 pm Reply with quote

Hi, thanks for your reply, no, my site url doesn't have a trailing slash, it is the same as the 'good' example. I wasn't quite sure what to expect in the URL, but it would have been nice to see the story title rather than content-4.html etc. Is it just the rewrite rules I would have to modify to get the story title or is there any other files too that would need modifying?
Thanks for your help Smile
 
spasticdonkey
PostPosted: Tue Sep 24, 2013 4:23 pm Reply with quote

You need to edit all the links generated within the module, add a function for cleansing/formatting titles, as well as modify rewrite rules. Not incredibly difficult yet can be time consuming finding all of the links.

I have a mod for doing this in Content Plus but it was written for an older version (2.4). There shouldn't be too many differences with the current version; although there is only a file-comparison for the mod displaying the edits (not step by step instructions). Not as easy to work from but the step-by-step instructions I had need updating (will have them for our next release later on)
Only registered users can see links on this board! Get registered or login!

don't have a mod for News at this time, but the same approach would work for any module.
 
jane65
PostPosted: Tue Sep 24, 2013 4:56 pm Reply with quote

Thanks very much for the mod spasticdonkey, I've just downloaded it and will take a look at it tomorrow.
 
jane65
PostPosted: Wed Sep 25, 2013 5:27 pm Reply with quote

Hi, I tried the mod, but its not displaying any titles. The content modules file edits were the same, as I am actually using a modified 2.4 version of the content module on the 2.51 system.

I am wondering if it could be something to do with the code I added to the jquery/nukenav.php file in order to create a few dropdown menus on my navbar that link to individual Content Module categories and pages.

I've now noticed that a couple of the dropdown menus are displaying the URLs differently - for example, the menu that is coded to change to a different category dropdown menu after login is still showing the long URL, whereas the other menu links where the code doesn't change the category after login is showing the shortened URL as in content-4.html etc.

Do you think I may need to replace the links in my jquery/nukenav.php file too with rewrite type links, like in the mod for the content module files to get this to work?

Thank you Smile
 
spasticdonkey
PostPosted: Wed Sep 25, 2013 6:00 pm Reply with quote

Was shortlinks working 100% correctly prior to installing the mod? That is required Smile

nukeNAV doesn't normally link directly to Content pages and categories so no edits were included in the mod, but if you placed links there they will need to be edited as the links in the module were. for example (just an example since I don't know what your code looks like)

Code:
<a href="modules.php?name='.$module_name.'&amp;pa=list_pages_categories&amp;cid='.$mycategory.'" title="'.$row['title'].'">'.$row['title'].'</a>

should be
Code:
<a href="modules.php?name='.$module_name.'&amp;pa=list_pages_categories&amp;cid='.$mycategory.'&amp;title='.gt_url($row['title']).'" title="'.$row['title'].'">'.$row['title'].'</a>


Do the links behave differently from within the Content module, compared to somewhere else on the site?

If you try to visit a page by typing the custom url in does it display? i.e.
mysite.com/content-4-my-page-title.html
(replacing "4" and "my-page-title" with the actual id/title. The title will be converted to all lowercase and any characters other than A-Z are replaced by dashes - there is also additional code to help prevent multiple dashes in a row, within the title)

see if any of that helps Smile
 
jane65
PostPosted: Thu Sep 26, 2013 12:15 pm Reply with quote

Hi,

Thanks very much for all the info, it helped greatly. I have managed to get the titles showing now! Smile It was the Content module code added to the jquery/nukenav.php that needed its links changed.

Just in case anyone else wants to use the Content Shortlinks mod and has added the same or similar Content module modification to the jquery/nukenav.php, whereby the navigation bar displays links to the content pages of the Content module in a dropdown menu (it was discussed how to do it in another thread somewhere on the forum), I have posted the modified code below.

This code makes the navigation dropdown menu switch to showing a different Content category and pages after the User logs in.
Code:
if (is_active('Content')) {

   if (is_user($user)) {
      $contid = '5';
      $conttitle = 'Your Title';
      $XXcid = '4';
   } else {
      $contid = '3';
      $conttitle = 'Your Title';
      $XXcid = '2';
  }
   if (is_user($user)) {
          $nukeNAV .= '<li><a href="content-5-your-page-title.html">' . $conttitle . '</a>';
} else {
$nukeNAV .= '<li><a href="content-3-your-page-title.html">' . $conttitle . '</a>';
}
  $NAVresult = $db->sql_query('SELECT * FROM '.$prefix.'_pages pages WHERE active=\'1\' AND cid=\''.$XXcid.'\'');
   $NAVnumrows = $db->sql_numrows($NAVresult);
      if ($NAVnumrows > 0) {
      $nukeNAV .= '
     <ul>';
      while ($XXrow = $db->sql_fetchrow($NAVresult)) {
      $XXpid = $XXrow['pid'];
      $XXtitle = $XXrow['title'];
      // display cat
      $nukeNAV .= '
   <li><a href="modules.php?name=Content&amp;pa=showpage&amp;pid='.$XXpid.'&amp;title='.gt_url($XXrow['title']).'">'.$XXtitle.'</a>';
   // content for cat
   $NAVresult2 = $db->sql_query('SELECT * FROM '.$prefix.'_pages WHERE active=\'1\' AND pid=\''.$XXpid.'\'');
       if ($NAVnumrows2 > 0) {
      $nukeNAV .= '
     <ul>';
      while ($XXrow2 = $db->sql_fetchrow($NAVresult2)) {
      $XXpid = $XXrow2['pid'];
      $XXtitle2 = $XXrow2['title'];
      $nukeNAV .= '
   <li><a href="modules.php?name=Content&amp;pa=showpage&amp;pid='.$XXpid.'" title="">'.$XXtitle2.'</a></li>';
      }
      $nukeNAV .= '
     </ul>
   </li>';
      }else{
       $nukeNAV .= '</li>';
     }
}
   if (is_user($user)) $nukeNAV .= '';
   $nukeNAV .= '
  </ul>
</li>';
   }else{
   $nukeNAV .= '</li>';
   }
}


This code produces a dropdown menu containing the links to the Content module pages that remain the same after login.

Code:
if (is_active('Content')) {

   $nukeNAV .= '
<li><a href="content-cat-2-your-page-title.html">Your Page Title</a>';
   $NAVresult = $db->sql_query('SELECT * FROM '.$prefix.'_pages pages WHERE active=\'1\' AND cid=2');
   $NAVnumrows = $db->sql_numrows($NAVresult);
      if ($NAVnumrows > 0) {
      $nukeNAV .= '
     <ul>';
      while ($XXrow = $db->sql_fetchrow($NAVresult)) {
      $XXpid = $XXrow['pid'];
      $XXtitle = $XXrow['title'];
      // display cat
      $nukeNAV .= '
   <li><a href="modules.php?name=Content&amp;pa=showpage&amp;pid='.$XXpid.'&amp;title='.gt_url($XXrow['title']).'">'.$XXtitle.'</a>';
   // content for cat
   $NAVresult2 = $db->sql_query('SELECT * FROM '.$prefix.'_pages WHERE active=\'1\' AND pid=\''.$XXpid.'\'');
       if ($NAVnumrows2 > 0) {
      $nukeNAV .= '
     <ul>';
      while ($XXrow2 = $db->sql_fetchrow($NAVresult2)) {
      $XXpid = $XXrow2['pid'];
      $XXtitle2 = $XXrow2['title'];
      $nukeNAV .= '
   <li><a href="modules.php?name=Content&amp;pa=showpage&amp;pid='.$XXpid.'">'.$XXtitle2.'</a></li>';
      }
      $nukeNAV .= '
     </ul>
   </li>';
      }else{
      $nukeNAV .= '</li>';
      }
}
   if (is_user($user)) $nukeNAV .= '
  <li><a href="modules.php?name=Content&amp;pa=add_page" title=""></a></li>';
   $nukeNAV .= '
  </ul>
</li>';
   }else{
   $nukeNAV .= '</li>';
   }
}
[/b]
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> nukeSEO

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©