Author |
Message |
jane65
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Feb 24, 2009
Posts: 81
Location: UK
|
Posted:
Mon Sep 23, 2013 9:17 am |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
Life Cycles Becoming CPU Cycles
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jul 18, 2004
Posts: 579
|
Posted:
Mon Sep 23, 2013 12:38 pm |
|
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.
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 23, 2013 3:49 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 23, 2013 3:58 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/3234de284ee21bd39eecd.jpg)
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Mon Sep 23, 2013 4:19 pm |
|
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! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 23, 2013 6:17 pm |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 23, 2013 6:26 pm |
|
You should copy the ShortLinks.htaccess content from 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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 23, 2013 6:40 pm |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 23, 2013 7:09 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 24, 2013 5:57 am |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 24, 2013 6:22 am |
|
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&pa=list_pages_categories&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&pa=showpage&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&pa=showpage&pid='.$XXpid.'" title="">'.$XXtitle2.'</a></li>';
}
$nukeNAV .= '
</ul>
</li>';
}else{
$nukeNAV .= '</li>';
}
}
if (is_user($user)) $nukeNAV .= '
<li><a href="modules.php?name=Content&pa=add_page" title=""></a></li>';
$nukeNAV .= '
</ul>
</li>';
}else{
$nukeNAV .= '</li>';
}
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Tue Sep 24, 2013 8:08 am |
|
you shouldn't have to edit nukeNAV. Does your site url in admin/preferences have a trailing slash on it? It shouldn't.
Good http://yoursite.com
Bad http://yoursite.com/
(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). |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 24, 2013 12:40 pm |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 24, 2013 4:23 pm |
|
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)
http://web-cms-designs.com/cms-5-seo-tips-title-in-the-url-for-content-plus.html
don't have a mod for News at this time, but the same approach would work for any module. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 24, 2013 4:56 pm |
|
Thanks very much for the mod spasticdonkey, I've just downloaded it and will take a look at it tomorrow. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Sep 25, 2013 5:27 pm |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Sep 25, 2013 6:00 pm |
|
Was shortlinks working 100% correctly prior to installing the mod? That is required
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.'&pa=list_pages_categories&cid='.$mycategory.'" title="'.$row['title'].'">'.$row['title'].'</a>
|
should be
Code:<a href="modules.php?name='.$module_name.'&pa=list_pages_categories&cid='.$mycategory.'&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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jane65
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Sep 26, 2013 12:15 pm |
|
Hi,
Thanks very much for all the info, it helped greatly. I have managed to get the titles showing now! 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&pa=showpage&pid='.$XXpid.'&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&pa=showpage&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&pa=showpage&pid='.$XXpid.'&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&pa=showpage&pid='.$XXpid.'">'.$XXtitle2.'</a></li>';
}
$nukeNAV .= '
</ul>
</li>';
}else{
$nukeNAV .= '</li>';
}
}
if (is_user($user)) $nukeNAV .= '
<li><a href="modules.php?name=Content&pa=add_page" title=""></a></li>';
$nukeNAV .= '
</ul>
</li>';
}else{
$nukeNAV .= '</li>';
}
}
| [/b] |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|