× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

.htaccess to hide share folder

dannas1
Tutor

.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
Message 1 of 6
StephenB
Guru

Re: .htaccess to hide share folder

Normally you would tell frontview to redirect web access - viewtopic.php?f=23&t=58926
Message 2 of 6
dannas1
Tutor

Re: .htaccess to hide share folder

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 😄
Message 3 of 6
StephenB
Guru

Re: .htaccess to hide share folder

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.
Message 4 of 6
dannas1
Tutor

Re: .htaccess to hide share folder

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
Message 5 of 6
StephenB
Guru

Re: .htaccess to hide share folder

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.
Message 6 of 6
Top Contributors
Discussion stats
  • 5 replies
  • 1620 views
  • 1 kudo
  • 2 in conversation
Announcements