Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I wan to change my premalinks to attachment pages from http://example.com/.../attachemnt/something to http://example.com/.../attachemnt/something/something.jpg

It should simply add filename but with nice url, I tried with add query arg() but this builds url query like ?name=something.jpg.

Is there solution to achieve this without hard coding anything to wordpress?

share|improve this question
    
Why would you want to do that? Would it not be easier to reference the actual file? eg. wp-content/uploads/2010/12/yourfile.jpg if you want the file name and extension in the URL.. –  t31os Dec 20 '10 at 10:40
2  
While the question is technically interesting, won't displaying image-like URL for HTML page be confusing? –  Rarst Jan 17 '11 at 8:19
add comment

1 Answer

This doesn't require a Wordpress modification per se, but if you prefer to do it that way, here is a decent tutorial: http://shibashake.com/wordpress-theme/wordpress-page-redirect. Some people would, however, prefer to do this via the .htaccess file, here is a quick guide on how to do redirects that way: http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/#red1.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.