- Posts: 10
COMMUNITY FORUM
Attachment doesn't work with advanced sef
- Nicola
- Topic Author
- Offline
- New Member
I've a category called news and a subcategory called breaking news.
I also have a menu item called news that show all news from subcategories (like breaking news).
With Advanced SEF and this settings:
URL Prefix for Category: none
use ID for article: no
use alias for article: yes
use category id: no
use category alias: yes
It works
But, If I set "URL Prefix for Category" to "article category", attachments return error 404
the url is domain.tld/news/download/"hash".html ->error 404
if I disable URL Prefix for Category the url is
domain.tld/news/download/"hash".html ->work
Am I doing something wrong?
Thank you
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
As a temporary measure, until we fix it, you can try a quick and dirty solution.
In the item.php file you change:
<?php echo $attachment->link; ?>[code]
with:
[code]
<?php $realLink = str_replace('news/', '', $attachment->link); ?>
<?php echo $realLink; ?>
The end result should be:
<?php $realLink = str_replace('news/', '', $attachment->link); ?>
<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $realLink; ?>">
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Nicola
- Topic Author
- Offline
- New Member
- Posts: 10
without advanced sef:
www.domain.tld/news/item/{id}-title.html
www.domain.tld/news/download/*hash*.html <- it works
with advanced sef but without category prefix
www.domain.tld/news/{id}-title.html
www.domain.tld/news/download/*hash*.html <- it works
with advanced sef and category prefix
www.domain.tld/news/sport/{id}-title.html
www.domain.tld/news/download/*hash*.html <- it doesn't work
if I manually wrote
www.domain.tld/news/sport/download/*hash*.html <- it works
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
It is working as expected.
I will map the master category in a menu item to replicate your setup.
Is sport a menu item as well?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Nicola
- Topic Author
- Offline
- New Member
- Posts: 10
EDIT: I don't see the PM function, so no, the category is called "notizie" (I've translated for you from italian to english). The subcategory is called "discipline".
The attachment doesn't have spaces or something else.
Thank you
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
www.joomlaworks.net/support/contact
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Nicola
- Topic Author
- Offline
- New Member
- Posts: 10
Krikor wrote: You can use the contact form
www.joomlaworks.net/support/contact
Hello, I've sent the email yesterday, hope it's arrived :-)
Thanks
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
Thank you once again Nicola for reporting this.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Nicola
- Topic Author
- Offline
- New Member
- Posts: 10
Without sef advance it works, with sef advance now it’s different:
if I use a custom prefix for article like “articolo”, download works, because the url is:
www.domain.tld/articolo/download/2_2204504bf19c4fc29d778e7a158fd5c1.html
If I use article category, attachment download return error 404 (the category isn’t present in url) because the url is:
www.domain.tld/notizie/download/2_2204504bf19c4fc29d778e7a158fd5c1.html
The category name isn’t wrote inside url.
I’ve created a new category called ‘cat’, with mother category ‘notizie’.
Then I wrote an article inside this category: same as before; with category as prefix it doesn’t work. It’s a render problem because if I manually wrote the category name inside the url it download the attached file.
So I've checked your url that work:
parent-category/another-cat/item/id-alias/download/hash is working properly.
it's different from mine, I've:
domain.tld/parent-category/download/hash
But if I manually wrote
domain.tld/parent-category/another-category/download/hash it works
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
Disable the redirect extension,
install the DEV version.
github.com/getk2/k2
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.