Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Slug of local wp install still shows name of the subfolder the install is in

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #167428
    rpk
    Participant

    I’ve locally installed WP with MAMP running in the background. I haven’t installed the wp files into the root folder (name: myhomepage) but in a subdirectory, randomly named with gd34WnqXym , for security purposes (wp-url: localhost:8888/myhomepage/gd34WnqXym/ site-url: localhost:8888/myhomepage/ ) . Everything is working fine. I am near the completion of my project, but today i’ve taken a look at the href absolute links in the html source.

    For functions like the_permalink the resulting output looks as expected like: localhost:8888/myhomepage/news/today-is-the-day means the href looks fine in the html source. But if i use functions like get_template_directory_uri(); or <?php bloginfo( 'template_directory' ); ?> i get

    http://localhost:8888/myhomepage/gd34WnqXym/wp-content/themes/mytheme/image.png
    

    Is there a way that the site-url is used instead of the wordpress-url? I am using wordpress 3.8.1 . Any suggestions are welcome. Thanks in advance Ralf

    #167433
    Alen
    Participant

    I think you’re mixing up few concepts here.

    For example the_permalink() function: Displays the URL for the permalink to the post currently being processed in WordPress loop.

    The URL returned is dependent on how your permalink structure is set up. Think of these URLs as the Application Interface. It’s how you get around and interact with the app.

    The get_template_directory_uri() retrieves template directory URI for the current theme. This returns path to your theme folder, which is a physical location on a disk, therefore the absolute path is returned.

    Hope that helps,
    -Alen

    #167457
    rpk
    Participant

    hmmmm actually i was hoping and expecting that wordpress would be “masking & hiding” the gd34WnqXym subfolder from the wordpress url and instead only show the site url no matter if i use relative links like the permalink like you said as well as in absolute one and that the visitor would never run into the gd34WnqXym folder name no matter if its in the adressbar or in the html source. but i guess it seems that isn’t working. so that security suggestion i’Ve found and thought would be useful is actually useless. ;) damn. would have been nice.

    #167523
    __
    Participant

    so that security suggestion i’Ve found and thought would be useful is actually useless

    If you’re talking about the idea that “masking and hiding” ever offers any sort of security, then yes, it’s a (mostly) useless suggestion. Another user brought up a similar conversation a couple weeks ago; some of those suggestions might interest you.

    #167607
    rpk
    Participant

    thanks traq! on one hand for confirming my suspicion after researching that field again and on the other hand for the suggestions in the other thread!

    #167609
    __
    Participant

    no problem; good luck

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.