Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Joomla Bridge Support => Topic started by: Articuno on July 02, 2008, 02:50:50 PM

Title: SOLVED mod_login links fail with SEF urls on Joomla
Post by: Articuno on July 02, 2008, 02:50:50 PM
Don't know enough about php to tweak this myself, but the problem is these links on mod_login do not work when I enable SEF urls on Joomla:

New Messages
Show Unread Posts Since Last Visit
Show New Replies Since Last Visit
Logout

Forum is unwrapped, SEF is disabled on it... I know I just need to get the URLs to go directly to the forum which is at myurl.com/forum/
But the question is how..? Could anyone please help? Thankyou!
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Orstio on July 02, 2008, 07:44:35 PM
Some information would help.

SMF version?
Joomla version?
Bridge version?

URL?

QuoteI know I just need to get the URLs to go directly to the forum which is at myurl.com/forum/

The URLs for a bridged forum should never go to the stand alone location....
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Articuno on July 03, 2008, 01:51:22 AM
QuoteThe URLs for a bridged forum should never go to the stand alone location....

Don't see why not, the site actually links to /forum/ so why can't the login box have links to /forum/whatever ? It's still bridged.

SMF version 1.1.5
Joomla version 1.1.12
Bridge version - unsure just now, downloaded it around Feb 07.

What I'm saying is, I don't see why I can't manually change the urls from this:

http://www.lugia.us/component/option,com_smf/Itemid,31/action,unread/

Into this:

http://www.lugia.us/forum/index.php?action=unread

Or at least get the SEF URLs to work somehow....?
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Orstio on July 03, 2008, 07:19:44 AM
Because this is your bridge:

http://www.lugia.us/component/option,com_smf/Itemid,31

And this is not bridged in any way:

http://www.lugia.us/forum/index.php
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Articuno on July 03, 2008, 10:22:05 AM
That's funny, I am perfectly able to login to the whole site using just the standalone forum, so are my members, same for logout, no problems.
But if you say that should be my forum url, why does nothing actuallty work with the SEF urls?
Also.. the link you gave, http://www.lugia.us/component/option,com_smf/Itemid,31 leads to my site homepage.. not the forum..
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Orstio on July 03, 2008, 10:29:51 AM
Can you post the contents of your .htaccess?
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Articuno on July 03, 2008, 01:32:28 PM
Certainly it's:

ErrorDocument 404 http://lugia.us/404/404.php


AddType application/octet-stream .avi  .mpg .AVI .wmv .WMV .mov .MOV .MPG
Options +FollowSymLinks


##
# @version $Id: htaccess.txt 5973 2006-12-11 01:26:33Z robs $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##
#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
# Only use one of the two SEF sections that follow.  Lines that can be uncommented
# (and thus used) have only one #.  Lines with two #'s should not be uncommented
# In the section that you don't use, all lines should start with #
#
# For Standard SEF, use the standard SEF section.  You can comment out
# all of the RewriteCond lines and reduce your server's load if you
# don't have directories in your root named 'component' or 'content'
#
# If you are using a 3rd Party SEF or the Core SEF solution
# uncomment all of the lines in the '3rd Party or Core SEF' section
#
#####################################################
#####  SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
#
# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# May need to be uncommented.  If you are running your Joomla!/Mambo from
# a subdirectory the name of the subdirectory will need to be inserted into this
# line.  For example, if your Joomla!/Mambo is in a subdirectory called '/test/',
# change this:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# to this:
# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes##
#
#####################################################
##  Can be commented out if causes errors, see notes above.
#
#  mod_rewrite in use
RewriteEngine On
#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla!/MamboDirectory (just / for root)
# RewriteBase /
########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section
########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
RewriteCond %{HTTP_HOST} !^www\.lugia\.us$
RewriteRule ^(.*)$ http://www.lugia.us/$1 [R=301,L]
RewriteCond s%{HTTPS} ^((s)on|s.*)$ [NC]
RewriteRule ^/*(.+/)?([^.]*[^/])$ http%2://%{HTTP_HOST}/$1$2/ [L,R=301]
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Orstio on July 03, 2008, 02:05:00 PM
Use this instead:

ErrorDocument 404 http://lugia.us/404/404.php


AddType application/octet-stream .avi  .mpg .AVI .wmv .WMV .mov .MOV .MPG
Options +FollowSymLinks


##
# @version $Id: htaccess.txt 5973 2006-12-11 01:26:33Z robs $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##
#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
# Only use one of the two SEF sections that follow.  Lines that can be uncommented
# (and thus used) have only one #.  Lines with two #'s should not be uncommented
# In the section that you don't use, all lines should start with #
#
# For Standard SEF, use the standard SEF section.  You can comment out
# all of the RewriteCond lines and reduce your server's load if you
# don't have directories in your root named 'component' or 'content'
#
# If you are using a 3rd Party SEF or the Core SEF solution
# uncomment all of the lines in the '3rd Party or Core SEF' section
#
#####################################################
#####  SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
#
# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# May need to be uncommented.  If you are running your Joomla!/Mambo from
# a subdirectory the name of the subdirectory will need to be inserted into this
# line.  For example, if your Joomla!/Mambo is in a subdirectory called '/test/',
# change this:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# to this:
# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes##
#
#####################################################
##  Can be commented out if causes errors, see notes above.
#
#  mod_rewrite in use
RewriteEngine On
#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla!/MamboDirectory (just / for root)
# RewriteBase /
########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section
########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
RewriteCond %{HTTP_HOST} !^www\.lugia\.us$
RewriteRule ^(.*)$ http://www.lugia.us/$1 [R=301,L]
RewriteCond s%{HTTPS} ^((s)on|s.*)$ [NC]
RewriteRule ^/*(.+/)?([^.]*[^/])$ http%2://%{HTTP_HOST}/$1$2/ [L,R=301]
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Articuno on July 03, 2008, 02:48:03 PM
Sadly, it all still leads to the home page.. and after it does that, the links on mod_login lead to 404. I'm beginning to worry now.

Example:

Show unread topics since last visit on mod_login:

http://www.lugia.us/component/option,com_smf/Itemid,31/action,unread/

Click it and get the unread topics just fine. Click any of those, eg. http://www.lugia.us/component/option,com_smf/Itemid,31/topic,1210.0/topicseen,topicseen
and get homepage.

Click unread topics since last visit again, 404.
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Orstio on July 03, 2008, 03:16:42 PM
It's giving you a 404 for every link that does not have a slash on the end.

http://www.lugia.us/component/option,com_smf/Itemid,31/topic,1210.0/topicseen,topicseen/

Is the same link you have above, with a slash on the end.

RewriteCond %{HTTP_HOST} !^www\.lugia\.us$
RewriteRule ^(.*)$ http://www.lugia.us/$1 [R=301,L]
RewriteCond s%{HTTPS} ^((s)on|s.*)$ [NC]
RewriteRule ^/*(.+/)?([^.]*[^/])$ http%2://%{HTTP_HOST}/$1$2/ [L,R=301]


What is that part on the end for?
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Articuno on July 03, 2008, 03:35:37 PM
That part forces a / to the end of my directory urls like /forum/ and /gallery/ and forces a www, without the www, http://lugia.us and http://www.lugia.us are treated as seperate sites.. so you could be logged into one and not the other.

Ok this might be difficult to explain but here goes. I've got my site setup like this:

htdocs/tst/ - TST is Lugia.us, that domain points to htdocs/tst/
Without that foward slash, if you try to access any directory of Lugia.us, like /forum, it starts going /tst/forum
So you end up with Lugia.us/tst/forum rather than Lugia.us/forum which is really annoying. I took that code away temporarily and no more 404 errors, but now I'm stuck with the forward slash and www issue.
Title: Re: mod_login links fail with SEF urls on Joomla
Post by: Articuno on July 05, 2008, 02:46:35 PM
Fixed, I have a new force www script that doesn't cause the 404 issue!