Home › Forums › Back End › Slug of local wp install still shows name of the subfolder the install is in
- This topic is empty.
-
AuthorPosts
-
April 2, 2014 at 4:43 pm #167428rpkParticipant
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 likeget_template_directory_uri();
or<?php bloginfo( 'template_directory' ); ?>
i gethttp://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
April 2, 2014 at 7:05 pm #167433AlenParticipantI 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,
-AlenApril 3, 2014 at 6:04 am #167457rpkParticipanthmmmm 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.
April 3, 2014 at 1:51 pm #167523__Participantso 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.
April 4, 2014 at 11:35 am #167607rpkParticipantthanks 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!
April 4, 2014 at 11:57 am #167609__Participantno problem; good luck
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.