February 10, 2012, 17:45:26 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Check your Page Rank, Backlinks, or Link Popularity in our tools section.
 
  Home   Forum   Help Search Directory Calendar Login Register    RSS 2.0 feedAtom feed


News
Check your Page Rank, Backlinks, or Link Popularity in our tools section.
Pages: [1] 2
  Print  
Author Topic:

SEO4SMF adds adds extra slash "/" to search engine friendly URL

 (Read 8301 times)
0 Members and 1 Guest are viewing this topic.
rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« on: January 21, 2009, 20:09:41 »

I am running SMF 1.1.7 and have installed SEO4SMF 0.2.9.10. On top of this I have insyalled Tiny portal 1.0.6.
I am displaying the recent posts on the home page. At the bottom of some of the blocks you see "Read More" which is pointing to the actual post in the forum. The URL has an extra slash "/" before the post name which makes the URL invalid. I.E http://www.mydomain.com/forum//topic.html I looked in the code. This is coming from the following code in the TPmodules.php
$row['body'] .= '...... <a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '".0>' . $txt['tp-readmore'] . '[/url]';

So it looks like "ID_TOPIC" has an extra / at the beginning. But the ID_TOPIC is being set inside the seo4smf-redirect (I think). When I turn off seo4smf or when I turn off search engine friendly url, then it works just fine.

So for example when Friendly URL is turned on, the "Read More" link is pointing to http://www.brostalk.com/forum//welfare_check-t62.0.html; which doesnt work because of the extra "/" before the topic. But then if I turn off Friendly URL, then the Read More link points to http://www.brostalk.com/forum/index.php?topic=62 which works just fine.

Any idea how I can fix this? Thanks in advance.
Logged


LinuxGuy
Sr. Member
****

Points: 0
Offline Offline

Posts: 265


WWW
« Reply #1 on: January 22, 2009, 11:47:11 »

This is a bug and was I think required to fix. However, fix is to include "Board Name" in URL. Can be enable from SEO4SMF admin.
Logged

rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #2 on: January 22, 2009, 16:54:33 »

Thanks for trying to help. I have tried your suggestion. I went to the SEO4SMF option page and chose to add Board name to the URL, but that did not fix the issue. It is still adding the extra slash "/". So I am still getting // in the URL. maybe there should be something in between the slashes and is missing??
Logged
LinuxGuy
Sr. Member
****

Points: 0
Offline Offline

Posts: 265


WWW
« Reply #3 on: January 23, 2009, 14:51:48 »

See.. I had similar problem in one of my board, I simply enabled show board name in URL .. though I wanted to remove it.

Enable show board in URL in your forum and then get back here.. I want to see it myself.
Logged

rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #4 on: January 23, 2009, 20:07:27 »

Take a look at the attachment.
I have turned on Board name in all 4 field and I still have the same issue.
Is this what you are referring to?
 
Logged
LinuxGuy
Sr. Member
****

Points: 0
Offline Offline

Posts: 265


WWW
« Reply #5 on: January 25, 2009, 11:54:38 »

No ..

In SEO4SMF admin, there is an option :
Remove board from front of topic ? <-- Uncheck it.
Logged

rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #6 on: January 26, 2009, 05:40:09 »

Thanks for the reply. I appreciate the help.
I found the option you are referring to and unchecked it. But unfortunately it did not make much difference. I am still getting the double slashes in the URL Sad
Logged
Minare
Jr. Member
**

Points: 1
Offline Offline

Posts: 20


WWW
« Reply #7 on: January 26, 2009, 14:38:03 »

rostam

May I have you htaccess ?
Logged

www.minare.net
rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #8 on: January 26, 2009, 15:33:19 »

Sure, you can. Here it is. Thanks for helping.

----------------------------------------------

RewriteEngine on

#Some apache servers need Rewritebase.
#delete # from start of Rewrite base to enable it.
#If your forum is something like http://www.forum-example.com/forum then modify your
#RewriteBase in this way: RewriteBase /forum

RewriteBase /forum

#Archive/Sitemaps
RewriteRule ^sitemaps-([a-zA-Z0-9-]*)\.html index.php?dummy=1&action=seo4smfsitemaps&sa=$1 [L]

#uncomment if you use beautifying url actions
RewriteCond %{REQUEST_METHOD} =GET
RewriteCond %{QUERY_STRING} ^action=(.*)$
RewriteRule  ^(.*)$ seo4smf-redirect.php?a=%1 [R=301,L]

RewriteCond %{QUERY_STRING} ^topic=([0-9]*)$
RewriteRule  ^(.*)$ seo4smf-redirect.php?t=%1 [R=301,L]

RewriteCond %{QUERY_STRING} ^topic=([0-9]*).([0-9]*)
RewriteRule  ^(.*)$ seo4smf-redirect.php?t=%1 [R=301,L]

RewriteCond %{QUERY_STRING} ^board=([0-9]*).([0-9]*)
RewriteRule  ^(.*)$ seo4smf-redirect.php?b=%1 [R=301,L]

RewriteCond %{QUERY_STRING} ^action=profile;u=([0-9]*);(.*)$
RewriteRule  ^(.*)$ seo4smf-redirect.php?u=%1;param=%2 [R=301,L]

RewriteCond %{QUERY_STRING} ^action=profile;u=([0-9]*)
RewriteRule  ^(.*)$ seo4smf-redirect.php?u=%1 [R=301,L]

#Tiny Portal Old Url's
RewriteCond %{QUERY_STRING} ^page=([0-9]*)
RewriteRule  ^(.*)$ seo4smf-redirect.php?p=%1 [R=301,L]

#Rewrite Old urls
RewriteRule  ^index.php/board,(.*).html seo4smf-redirect.php?b=$1 [R=301,L]
RewriteRule  ^index.php/board,(.*).html;(.*) seo4smf-redirect.php?b=$1&o=$2 [R=301,L]

RewriteRule  ^index.php/topic,(.*).html seo4smf-redirect.php?t=$1 [R=301,L]
RewriteRule  ^index.php/topic,(.*).html;(.*) seo4smf-redirect.php?t=$1&o=$2 [R=301,L]

#Bad Url's
RewriteCond %{REQUEST_URI} ^(.*)\.html$
RewriteCond %{REQUEST_URI} !^(.+)/(.*)-t([0-9]*)\.([0-9]*).html$
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html seo4smf-redirect.php?t=$2 [R=301,L]

RewriteRule  ^(.*)/-t(.*).html seo4smf-redirect.php?t=$2 [R=301,L]
RewriteRule  ^-b(.*)/$ seo4smf-redirect.php?b=$1 [R=301,L]
RewriteRule  ^-b(.*)/(.*)$ seo4smf-redirect.php?b=$1 [R=301,L]
RewriteRule  ^(.*)/-b(.*)/$ seo4smf-redirect.php?b=$2 [R=301,L]

#New board URL's
RewriteRule ^(.*)-b([0-9]*)\.([0-9]*)/;(.*) index.php?dummy=1&board=$2.$3&$4 [L]
RewriteRule ^(.*)-b([0-9]*)\.([0-9]*)/$ index.php?dummy=2&board=$2.$3 [L]
RewriteRule ^(.*)-b([0-9]*)\.([0-9])$ index.php?dummy=2&board=$2.$3 [L]

#New topic URL's
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;((\?:from|msg|new)[0-9]*);(.*)$ index.php?dummy=1&topic=$2.$4&$6 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;((\?:from|msg|new)[0-9]*) index.php?dummy=1&topic=$2.$4 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html;(.*)$ index.php?dummy=1&topic=$2.$3&$4 [L]
RewriteRule ^(.*)-t([0-9]*)\.([0-9]*)\.html$ index.php?dummy=1&topic=$2.$3 [L]

#New profiles URL's
RewriteRule ^(.*)-u([0-9]*)\.html;sa,(.*);start,([0-9]*);delete,([0-9]*);sesc,([a-z0-9]*)$ index.php?dummy=1&action=profile;u=$2;sa=$3;start=$4;delete=$5;sesc=$6 [L]
RewriteRule ^(.*)-u([0-9]*)\.html;sa,(.*);start,([0-9]*)$ index.php?dummy=1&action=profile;u=$2;sa=$3;start=$4 [L]
RewriteRule ^(.*)-u([0-9]*)\.html;sa,(.*)$ index.php?dummy=1&action=profile;u=$2;sa=$3 [L]
RewriteRule ^(.*)-u([0-9]*)\.html index.php?dummy=1&action=profile;u=$2 [L]

#New Tinyportal Articles URL's
RewriteRule ^(.*)-p([0-9]*)\.html index.php?dummy=1&page=$2 [L]

#New action Url's - uncomment if you use beautifying url actions
RewriteRule ^(.*)\.html(.*)$ index.php?dummy=1;action=$1;$2 [L]
RewriteRule ^(.*)\.html$ index.php?dummy=1;action=$1 [L]

#Sitemaps
RewriteRule sitemap.xml sitemaps.php [L]
RewriteRule urllist.txt urllist.php [L]
Logged
rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #9 on: January 26, 2009, 20:43:00 »

OK, this is very interesting. Just to see if there is something wrong with the .htaccess file, I commented every single line on the .htaccess file None of the links in the menu worked any more...

Not Found
The requested URL /forum/admin.html was not found on this server.

But amazingly the "Read More" from the recent posts on the front page still does have a double // in the URL. I dont get this, do you?
Logged
Minare
Jr. Member
**

Points: 1
Offline Offline

Posts: 20


WWW
« Reply #10 on: January 26, 2009, 20:44:31 »

Try commenting this line :

RewriteCond %{REQUEST_URI} !^(.+)/(.*)-t([0-9]*)\.([0-9]*).html$
Logged

www.minare.net
rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #11 on: January 27, 2009, 06:08:41 »

I commented the line you suggested and it still did not work.
To be honest I did not expect that to work. Because as I mentioned above, I commented every single line in the .htaccess file and the "Read More" URLs still had double // in them Sad

UPDATE: Also I realized by commenting that line the topic URLS in the board will no longer work. You will get 404
« Last Edit: January 27, 2009, 06:18:30 by rostam » Logged
rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #12 on: January 27, 2009, 12:23:36 »

I dont think this has anything to do with the .htaccess. This sounds like a bug to me. Please correct me if I am wrong. But this link is coming from the following code in the TPmodules.php

$row['body'] .= '...... <a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '".0>' . $txt['tp-readmore'] . '[/url]';

Which translates to something like: http://www.brostalk.com/forum//test-t69.0.html;

Between those two // there should be the board name which is missing. That is why the URL is not working. Shouldnt the code be something like:

$row['body'] .= '...... <a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '?topic=' . $row['ID_TOPIC'] . '".0>' . $txt['tp-readmore'] . '[/url]';

I tried that, but that doesnt work. What do you think?
Logged
Minare
Jr. Member
**

Points: 1
Offline Offline

Posts: 20


WWW
« Reply #13 on: January 27, 2009, 15:19:35 »

You got a good point dude. Don't waste your time here, go and ask it in Simplemachines or Tinyportal

I wish I could help
Logged

www.minare.net
rostam
Jr. Member
**

Points: 0
Offline Offline

Posts: 12


« Reply #14 on: January 28, 2009, 12:28:21 »

Just to let you know I have started a thread to bring up this issue both on TP and SMF sites.
They think TP is working as designed and this is a SEO4SMF issue and need to be resolved in the mod. That is why I started this thread here.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
Valid XHTML 1.0! Valid CSS!