- Posts: 157
COMMUNITY FORUM
Replace space by dash in K2 Tags
- Goble002
- Topic Author
- Offline
- Premium Member
This issue has been raised several times here but haven't found the solution yet.
I have tags with 2 words for my k2 items. I cannot create menu items for these tags (since there are 100s of them). From a previous post:
I understand that browsers have different behaviours :You can't have spaces in URLs. K2 converts spaces to the appropriate characters according to the URL specification www.ietf.org/rfc/rfc1738.txt . Then it's up to the browser you are using to convert them back and display them correctly. Most modern browsers do that.
- Chrome : URL shown on item page (when hovered) : "mysite.com/photos/itemlist/tag/Test Tag" but will load: "mysite.com/photos/itemlist/tag/Test%20Tag"
- Edge : URL shown on item page (when hovered) and will load : "mysite.com/photos/itemlist/tag/Test%20Tag"
- FireFox : URL shown on item page (when hovered) and will load : "mysite.com/photos/itemlist/tag/Test Tag"
In "Enforce SEF URL character replacements", possible to convert space with dash ? I tried following but it won't work: "%20|-" and " |-"
Have tried below from StackOverflow but no success:
# remove spaces from start or after / RewriteRule ^(.*/|)[\s%20]+(.+)$ $1$2 [L] # remove spaces from end or before / RewriteRule ^(.+?)[\s%20]+(/.*|)$ $1$2 [L] # replace spaces by - in between RewriteRule ^([^\s%20]*)(?:\s|%20)+(.*)$ $1-$2 [L,R]
Any help will be much appreciated.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Goble002
- Topic Author
- Offline
- Premium Member
- Posts: 157
Like explained, I've tried "Enforce SEF URL character replacements". It's simply not working for me.
"Enforce SEF URL character replacements" > Yes
The default values in "SEF URL character replacements" are not doing anything, For example : tag "Àtest" is not being converted to "Atest".
I have disabled .htaccess, disable/enable SEF (just below). I have tried another joomla site (completely different): no luck as well. So could not be an extension conflict.
However for Joomla articles, tags with "Àtest" are converted to "Atest".
Extract from Joomla documentation
So Joomla Core will not help here."In Joomla!, each component is responsible for handling its own SEF URLs. Therefore, as the developer of a component, you will have to create your own router to allow your component to use SEF URLs."
Fotis wrote :
>> Like explained I can't afford to have menu item for the k2 tags."On the other hand, if you make distinct menu items, then you can create your own URL alias, in which case you can of course insert a dash between a tag's words."
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Goble002
- Topic Author
- Offline
- Premium Member
- Posts: 157
No. I was taking "À "as an example.
These are my 4 last entries:
ӭ|e, ю|yu, я|ya, |-, %20|-
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Goble002
- Topic Author
- Offline
- Premium Member
- Posts: 157
I would be glad to install whatever language pack required. My site is only in English. My issue is about the space in the URL. See my original post.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
See this: docs.joomla.org/International_Enhancements_for_Version_1.6#Custom_Transliteration_Support
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Goble002
- Topic Author
- Offline
- Premium Member
- Posts: 157
really appreciate your help on this. However may be I wrongly expressed myself and as such we are going in the wrong direction.
I need to remove a space from the URL (Space resulting from a 2 word tag example "test tag") . Then what would be the language pack which should handle special characters like space ? The space is my only issue. I don't have any other characters to be replaced.You need to add a language pack in Joomla for sure with a language that handles these special characters.
Like explained earlier, Joomla is removing automatically spaces from URL (Tag listing for Joomla Articles) for tags with a space like "test tag".Then and only then can Joomla (and K2) perform any such character replacements.
Please Log in or Create an account to join the conversation.
- Goble002
- Topic Author
- Offline
- Premium Member
- Posts: 157
any thoughts on this will be highly appreciated.
Am stuck with publishing my website because of search engines indexing / sharing links that might no longer exist.
Please Log in or Create an account to join the conversation.