Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Modify file download url
How can I remove the underscore from the url generated by file_download_link ?
Last edited by wornout (2013-07-01 08:04:15)
Offline
Re: Modify file download url
Do you mean in this type of URL?
http://www.example.com/file_download/2/example.zip
Offline
Re: Modify file download url
Yes!
Offline
Re: Modify file download url
I think it’s on line 309 of publish.php
in Textpattern 4.5.4
$out['s'] = 'file_download';
I don’t think there’s a way to change it without manually amending the core though.
Offline
Re: Modify file download url
Thanks!
Offline
Re: Modify file download url
Setting 'file_download' => 'myFileDownload'
in wet_babble could be a plugin alternative, though it depends on what you need exactly.
Offline
Re: Modify file download url
My purpose is to remove underscores from file link.
From this:
http://www.domain.it/file_download/etc...
to this:
http://www.domain.it/file-download/etc...
for example.
Offline
Re: Modify file download url
Should the modified links still be treated as txp file download links? Then try 'file_download' => 'file-download'
in wet_babble
. Otherwise, you can pass them trough rah_replace
, but Textpattern won’t recognize them as download links anymore.
Offline
Re: Modify file download url
etc wrote:
Should the modified links still be treated as txp file download links? Then try
'file_download' => 'file-download'
inwet_babble
.
It works!
Offline
Re: Modify file download url
Fine (edit: save in messy
mode)! I guess you can add some file_download
string to txp_lang
table to get the same result.
Last edited by etc (2013-07-01 13:43:31)
Offline
Re: Modify file download url
Just curious as to why you’d want to change that URL in the first place?
Offline
Re: Modify file download url
Because of SEO checker tool:
Great, you are not using underscores (these_are_underscores) in your URLs.
While Google™ treats hyphens (these-are-hyphens) as word separators, it does not treat underscores as word separators.
It was report as an error in the site review. It doesn’t have a big impact as well…
Last edited by wornout (2013-07-01 13:51:30)
Offline