NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

dannas1's avatar
dannas1
Tutor
Sep 16, 2013

.htaccess to hide share folder

hi all,

just after a bit of help with removing the share folder showing up in http requests.
so http://mydomain.com/mywebshare/
would so as
http://mydomain.com

plus any other pages would not show the mywebshare within the URL.

so far I have tried to form a custom conf file for apache from folling the directions below;
http://www.readynas.com/forum/viewtopic.php?f=36&t=61282#p343626

with the following info in;


Alias "/mywebshare" "/c/mywebshare"
<Location "/mywebshare">
Options FollowSymlinks -Indexes
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Location>


then tried the following .htaccess file added to the mywebshare share:



RewriteEngine on

#RewriteRule ^/(.*)$ /mywebshare/$1


seem to give me a 403 error.

anyone got any ideas?

thanks

5 Replies

Replies have been turned off for this discussion
  • Hi Stephen,

    many thanks for your time to reply, I don't think I made myself clear on what i'm looking to do.
    basically im trying to mask the http share from appearing in the url address....
    the default setting for the nas is for the domain/share to show.

    I would like just the domain to show (so hide the http folder share in url address bars). As far a I can tell this can be done with .htaccess and also within the httpd.conf files.

    I've also noted in other posts that Shares.conf adds some rewriterules to direct http traffic to the http share, but as I understand this file gets refreshed in reboots/ updates.

    I'm pretty noob with all this, so any basic guides would be welcome :D
  • StephenB's avatar
    StephenB
    Guru - Experienced User
    I think I'm still a little confused.

    -are you using the NAS to host your own web server?
    -are you wanting to access some or all of the shared folders over http?

    I am kind of thinking that all you want to do is prevent http://mydomain.com from redirecting to http://mydomain.com/mywebshare But I am not sure.

    Do you have an arm-based NAS (duo v2). That seems likely. This guide might help: http://www.rnasguide.com/2012/01/09/how ... -or-nv-v2/ If so, you might want to update your profile. The v1 (sparc) duo is quite different.
  • thanks Stephen,

    I'm using the NAS (v1 Sparc) to host a site. Currently setup via front view (enabling http access, to the share which is set to read only without login).

    so while I need the redirect (which works) i'll looking for a method to mask the share name appearing within the url in Brower address bars if possible.

    hope that makes sense?

    Cheers
  • StephenB's avatar
    StephenB
    Guru - Experienced User
    It does make sense, so thanks for clarifying.

    Though I don't know how to prevent the share name from appearing - maybe someone else here knows a trick to do that.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More