Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
file_download in 4.05 - new URL seems to have broken all my file links
I really like the new URL that adds the file name in 4.05, but on my site, it has broken all my links, I get a 404 error. I do have some modifications in my .htaccess file, but everything worked fine previously. Have a look:
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/order allow,deny
deny from 213.114.34.232
deny from 220.181.34.188
allow from all<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.andrewswihart\.net [NC]
RewriteRule ^(.*) http://www.andrewswihart.net/$1 [L,R=301]
RewriteRule ^(atom|rss)/?(.*)$ http://feeds.feedburner.com/andrewswihart [R=301,L]
RewriteRule set/([0-9]+) index.php?set=$1
RewriteRule img/([0-9]+) index.php?img=$1
RewriteRule set/([0-9]+)/img/([0-9]+) index.php?set=$1&img=$2
RewriteRule set/([0-9]+)/page/([0-9]+) index.php?set=$1&page=$2
RewriteRule tags/(.+) index.php?tags=$1
RewriteRule tags/(.)/page/([0-9]) index.php?tags=$1&page=$2
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) – [PT,L]RewriteRule ^(.*) index.php
</IfModule>#php_value register_globals 0
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://andrewswihart.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://andrewswihart.net$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.andrewswihart.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.andrewswihart.net$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3|mp4|wmv)$ – [F,NC]
RewriteCond %{REMOTE_ADDR} =213.114.34.232
RewriteCond %{REMOTE_ADDR} =220.181.34.188
RewriteRule .* – [F]
Last edited by aswihart (2007-07-05 19:37:00)
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
If you have hard-coded links (not generated using textpattern tags) everything should continue to work fine. The filename at the end is just a nicety (and good for feedreaders to determine the type).
If you go to /file_download/[number here] you should still see a download kicked off.
Maybe you should remove this, though?:
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3|mp4|wmv)$ – [F,NC]
Last edited by Walker (2007-07-05 19:48:54)
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
The links aren’t hard coded, they are generated by txp:file_download_list and look like this: http://www.andrewswihart.net/file_download/31/FMajulation.mp3
I just put in the plain .htaccess that comes with 4.05, and I still get the 404 error.
Last edited by aswihart (2007-07-05 20:10:00)
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
The 404 error is generated by apache, which means that textpattern never ever gets to see or handle the url (it’s not possible to give it back to the webserver to handle it). One possible and likely reason is the rewrite rule mentioned by Walker (which explicitly prevents the rewriting of urls that end in .mp3, which however is necessary for letting textpattern handle a download).
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
But, I put in the plain .htaccess file, and the error remains, I cleared my browser cache and everything, still 404 error. NOt to mention some color profile file I have on my site, extension .icm also don’t work, like this one: http://www.andrewswihart.net/file_download/50/226BW%28Digital%29-factory-R51-G47-B50.icm
Last edited by aswihart (2007-07-05 22:09:14)
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
Is anyone else getting this error? Any more ideas? Thanks for any help!
Offline
#7 2007-07-09 02:27:27
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: file_download in 4.05 - new URL seems to have broken all my file links
Hmm…
- Works: http://www.andrewswihart.net/file_download/36
- Doesn’t work: http://www.andrewswihart.net/file_download/36/I+Hate+It.mp3
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
Yep. I am using upm_file to assign files to individual articles, along with txp:file_download_list, if that makes any difference.
Offline
#9 2007-07-10 00:31:55
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: file_download in 4.05 - new URL seems to have broken all my file links
1. Create and upload a new text file named rewrite.log
.
2. Temporarily, add the following to the stock Txp .htaccess:
RewriteLogLevel 9
RewriteLog "/path/to/file/rewrite.log" # change this to match the path to the file on your server
3. Load up a couple file urls in your browser.
4. Remove (or comment out) the aforementioned lines from your .htaccess (it’s not a good idea to leave them in there for very long; only to be used for debugging purposes).
5. Finally, paste here the log file’s contents.
This might give us a clue as to what’s happening.
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
Mary,
I did what you said, but I can’t load my site at all with those lines, I get a 500 error code. I have the rewrite.log file in the public_html directory on my site (base html directory). This is what my .htaccess looks like:
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /relative/web/path/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
RewriteLogLevel 9
RewriteLog "rewrite.log"
</IfModule>
#php_value register_globals 0
Last edited by aswihart (2007-07-10 01:08:05)
Offline
#11 2007-07-10 01:39:57
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: file_download in 4.05 - new URL seems to have broken all my file links
The path needs to be an absolute path, like what you use for your txpath in config.php or your file preference.
Offline
Re: file_download in 4.05 - new URL seems to have broken all my file links
Ok just tell me what to do, I’m not too bright. I still get the error after I changed it to “/rewrite.log” or “/public_html/rewrite.log”.
Offline