How would one change the default url structure of attachments?

When I click on post images it redirects in a page with a url like this: http://localhost/?attachment_id=897. Can I set the default image link like http://localhost/wp-content/uploads/2012/05/dice.jpg instead of http://localhost/?attachment_id=818? Also how to style the attachments page? Should I have a page like attachments.php?

Related posts

Leave a Reply

1 comment

  1. Navigate to: Dashboard -> Settings -> Media

    Check this box: Organize my uploads into month- and year-based folders.

    Save changes.

    then

    Navigate to: Dashboard -> Settings -> Permalinks

    Select “Post name” under “Common Settings”

    Save changes.

    As far as styling an attachment page, you can either open up your page template file, and add a conditional check for is_attachment() or you can make an attachment.php file in your template directory. Read more about the template hierarchy for attachment display.

    http://codex.wordpress.org/Using_Image_and_File_Attachments