After months of preparation and a 20 hour marathon I've upgraded my largest site from .764 to 1.2.4 only to discover that the file based urls I've used for many years do not work.
This is an extremely serious problem for the site, is killing traffic and search engine position as I type because now every URL in thousands of pages has been changed, breaking countless bookmarks and search engine result links.
I'm desperately hoping that someone has already fixed this and it just hasn't made into this ticket, which is over a month old (wish i had seen it before hand)
http://code.zikula.org/core/ticket/2520
--
Damon
Catamaran Sailing at TheBeachcats.com
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Short URLs Are Broken in 1.2.4
-
- Rank: Softmore
- Registered: Dec 31, 1969
- Last visit: May 25, 2010
- Posts: 326
-
- Rank: Team Member
- Registered: Jan 05, 2003
- Last visit: May 28, 2010
- Posts: 776
I am not a ShortURLs expert, but I think there is some confusion here. The old ShortURLs implementation was based on explicit rewrite rules which were listed in .htaccess. You will see that your old .htaccess has many rules spanning several pages while the new one only has a few commands.
The new ShortURL implementation is based on a few generic rules with the ShortURL matching/decoding being handled by the Zikula theme code (in conjunction with optional module code).
So, to enable ShortURLs the way you had them in PN 0.764, do the following:
1) Turn Off Short URLs in your Zikula config (since you don't want the Zikula-powered solution)
2) Place the .htaccess from your 0.764 install into your Zikula root.
In theory this should work. But maybe I've gotten it all wrong; like I said, I don't use short-URLs much.
Greetings
Robert -
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
What is not working? Are your long URLs not converted to short URLs by the output filter? Are your short URLs not resolving to long URLs? -
- Rank: Softmore
- Registered: Dec 31, 1969
- Last visit: May 25, 2010
- Posts: 326
rgasch
I am not a ShortURLs expert, but I think there is some confusion here.
I wouldn't be surprised, I've been functioning on very little sleep the last few days.
rgasch
So, to enable ShortURLs the way you had them in PN 0.764, do the following:
1) Turn Off Short URLs in your Zikula config (since you don't want the Zikula-powered solution)
2) Place the .htaccess from your 0.764 install into your Zikula root.
I was really hoping that would work, because the ideal would be for the new 1.2.4 version of the site to have the exact same urls as the old, but that doesn't work at all.
dits
What is not working? Are your long URLs not converted to short URLs by the output filter? Are your short URLs not resolving to long URLs?
What happens is that when you use for instance {Web_Liinks} in a menu then /index.php?module=Links is converted to /module-Links.html (where the module URL name is Links) but that link is a 404 not found. It's the same on all modules.
One odd exception that might help track down the cause is that I made a link for a Downloads category using {Downloads:sublevel&cid=2&sortby=date:}the long version produced is
/index.php?module=Downloads&func=sublevel&cid=2&sortby=date
and short version is
/module-Downloads-sublevel-cid-2-sortby-date.html
and they both work.
but
/module-Downloads.html is 404
--
Damon
Catamaran Sailing at TheBeachcats.com -
- Rank: Softmore
- Registered: Dec 31, 1969
- Last visit: May 25, 2010
- Posts: 326
Related problem. After realizing that all my navigation was broken and that even if they worked, file based short urls in Zikula 1.2.4 are not going to be the same as in PN .764, I tried the directory based urls.
I've got a dozen other Zikula sites and always use the directory based urls since I like the style better for seo and those urls don't break down when emailed with only / as seperators.
Problem is that now all the {Web_Links} type links in menus produce correct working links like
/Links
and that Download category link I mention in the previous post becomes
/Downloads/sublevel/cid/2/sortby/date which works fine. (wish it had the name of category instead of cid)
But a big problem, I'm using News 2.6.2 as my start page module and all the news title links go to the same URL just
/news
even links produced by the news archive and the "read more" link show only /news instead of linking to a particular article.
Is that a bug with the 2.6.2 News or with short urls or with something I've screwed up?
--
Damon
Catamaran Sailing at TheBeachcats.com -
- Rank: Developer
- Registered: Jan 24, 2004
- Last visit: Oct 21, 2009
- Posts: 121
Look at your .htaccess
On line 58 where is a # before, its outcommented why ever???
delete the # and it will work.
Regards Petzi
--
Petzi-Juist :: ... welcome to my digital world ... -
- Rank: Softmore
- Registered: Dec 31, 1969
- Last visit: May 25, 2010
- Posts: 326
Petzi-Juist
Look at your .htaccess
On line 58 where is a # before, its outcommented why ever???
delete the # and it will work.
Thanks Petzi, but the .htaccess I'm using right now (for site in my sig) only has 28 lines, it's the file straight from the /docs menu shorturls.directory.htaccess renamed to .htaccess
The only addition to it is
suPHP_ConfigPath /home/example/www
so that the php.ini file applies to the whole site.
Code
# Zikula Application Framework
# ----------------------------------------------------------------------
# Place this file in your Zikula root directory, alongside the main
# index.php file
# ----------------------------------------------------------------------
# security options if they work in your environment. If you get a 500 error then they wont.
# These settings are best turned off in php.ini and will be on modern hosting environemnts.
#php_flag register_globals off
#php_flag magic_quotes_gpc off
suPHP_ConfigPath /home/example/www
# turn the rewriting engine on
RewriteEngine on
# Enable RewriteBase if Zikula is installed to a sub-directory
# RewriteBase /your/path/to/Zikula
# handle the favicon to prevent a full request to our engine
RewriteRule ^(.*)favicon.ico - [L]
# rewrite any unknown directories and files
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# re-add index.php back into the url
RewriteRule ^(.+) index.php? [L]
--
Damon
Catamaran Sailing at TheBeachcats.com -
- Rank: Team Member
- Registered: Dec 17, 2009
- Last visit: Apr 06, 2010
- Posts: 61
Like Petzi suggested, if you uncomment line 58, shorturls should work fine.
You can find the correct file here.
This is of course if you decide to use file-based shorturls.
Edited by tfotis on Oct 19, 2010 - 09:02 PM. -
- Rank: Developer
- Registered: Jan 24, 2004
- Last visit: Oct 21, 2009
- Posts: 121
What I write was for shorturls.file.htaccess and your first problem
Regards Petzi
--
Petzi-Juist :: ... welcome to my digital world ... -
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
damon
What happens is that when you use for instance {Web_Liinks} in a menu then /index.php?module=Links is converted to /module-Links.html (where the module URL name is Links) but that link is a 404 not found. It's the same on all modules.
In other words: your file based short URLs are working, they are just not redirected back to the proper long URLs. I suggest to restore your .htaccess file from your original .764 site. That should work. -
- Rank: Developer
- Registered: Jan 24, 2004
- Last visit: Oct 21, 2009
- Posts: 121
@ it should work ?! but it is overloaded with to many rules.
Make the change I write and it will work too.
Regards Petzi
--
Petzi-Juist :: ... welcome to my digital world ... -
- Rank: Softmore
- Registered: Dec 31, 1969
- Last visit: May 25, 2010
- Posts: 326
Petzi-Juist
What I write was for shorturls.file.htaccess and your first problem
Regards Petzi
Oh, ok, but here's the thing, I didn't change that file. The commented line was there in the original shorturls.file.htaccess file in a fresh Zikula 1.2.4 download.
quoting the original shorturls.file.htaccess beginning with line 57
Code
# General rules for modules with index.php?module=...
#RewriteRule ^module-([^-]+)\.p?html?$ index.php?module=&func=main [L,NC,NS]
RewriteRule ^module-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func= [L,NC,NS]
RewriteRule ^module-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func=&= [L,NC,NS]
RewriteRule ^module-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func=&=&= [L,NC,NS]
RewriteRule ^module-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func=&=&=&= [L,NC,NS]
Anyway I've decided that I might as well make the change to directory based urls that I prefer since even with file urls most links are going to change. Traffic is going to take a big hit but longterm the better urls should help the site. I just hope there is stability in this going forward to Zikula 2.0 or I will be on 1.2x for a long time.
--
Damon
Catamaran Sailing at TheBeachcats.com -
- Rank: Softmore
- Registered: Dec 31, 1969
- Last visit: May 25, 2010
- Posts: 326
dits
. I suggest to restore your .htaccess file from your original .764 site. That should work.
The .htaccess from .764 doesn't produce correct URL's in 1.2.4 with either short urls on or off in settings. Most urls just stay long and others get forms that don't get converted back.
--
Damon
Catamaran Sailing at TheBeachcats.com -
- Rank: Softmore
- Registered: Dec 31, 1969
- Last visit: May 25, 2010
- Posts: 326
damon
But a big problem, I'm using News 2.6.2 as my start page module and all the news title links go to the same URL just
/news
even links produced by the news archive and the "read more" link show only /news instead of linking to a particular article.
Hijacking my own thread:
So I'm giving up on file urls and switching to directory based, but still have the quoted problem.
--
Damon
Catamaran Sailing at TheBeachcats.com -
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
damon
dits
. I suggest to restore your .htaccess file from your original .764 site. That should work.
The .htaccess from .764 doesn't produce correct URL's in 1.2.4 with either short urls on or off in settings. Most urls just stay long and others get forms that don't get converted back.
Assuming you are using file based URLs:
In Postnuke .764 long URLs are converted to short URLs upon display by the regular expression in modules/Xanthia/plugins/outputfilter.shorturls.php. Upon fetching these short URLs from the server they are converted back to long URLs using the rewrite rules defined in the .htaccess file in your root.
In Zikula 1.2.4 long URLs are converted to short URLs in Xanthia upon display by the regular expression in system/pnRender/plugins/outputfilter.shorturls.php. Upon fetching these short URLs from the server they are converted back to long URLs using the rewrite rules defined in the .htaccess file in your root.
If you make sure that the rules in the outputfilter match the rules in the .htaccess file things will work.
Edited by dits on Oct 19, 2010 - 09:47 PM.
- Moderated by:
- Support
