Is there a way to allow .htaccess file in IIS windows hosting? - .htaccess

I'm using windows shared hosting with a wordpress site, and I used a theme that create .htaccess file which is not allowed in the windows hosting.
I don't need to simulate the .htaccess code, I just want to allow it to be existed not to run.
Is there a way to allow .htaccess file to be existed in IIS windows shared hosting?
for example: is there a way to allow it from web.config?
or a way to delete it automatically when existed?

Related

Is there a way to require a login when accessing a website run on Google Cloud?

I'm currently making a website using a VM instance on Google Cloud. I've tried to password-protect my website using .htaccess and .htpass so that people cannot access it until I have completed it, but I will still be able to see it (because I have the login). However, .htaccess and .htpass don't seem to be working, and I'm unsure if there's something wrong on my side or if they simply do not work on GCloud VM instances. If they do not work on GCloud instances, are there any alternatives?
If you are using Apache web server you need to enable the use of htaccess on the Apache configuration. Check these guides as references How To Enable & Set Up .htaccess File On Apache, How To Use the .htaccess File. Keep in mind the path of the Apache config file can be different, depends on which Linux distro or Windows OS are using.

How to hide directory listing of my website (a shared hosting)?

I'm trying to hide the directory listing of my website.
I'm currently working on a website hosted by 'hostinger'.
I know that i should change something in an apache-related file, but they(hostinger) say that
i cannot change that. cuz im using a 'shared' hosting service.
so the only way is to add some code in an .htaccess file.
RewriteEngine On
Options -Indexes
this is my current situation in my .htaccess file.
i've googled the info on how to do it, but it keeps listing my directory.
is there any way that i can prevent it?
or is it just impossible to accomplish with a shared hosting service?
Try this , prevent or allow the server to display the index of the files in the folders of your web server.
You can put a .htaccess file in each of your directory with this code
Options All -Indexes

How do I run a subdirectory on a seprate virtual directory on same server

I have a site, www.domain.com. I want to set up a blog which runs on a same server but in different virtual directory, and have it available a the domain www.domain.com/blog.
How would I go about doing this? If it were blog.domain.com, then it would be easy, but with www.domain.com/blog I'm not so sure.
I'm using Windows Server 2008 / IIS 7.
I have already been through these tutorial but If some one has better approach please do let me know
Tutorial1
Tutorial2
You should just be able to add it to the existing site. Something like
appcmd add VDIR /app.name:/<existingsite>/blog /path:/blog /physicalPath:/<whereYourBlogIs>
NOTE: appcmd is in the %windir%\system32\inetsrv\ directory on my machine.
Able to run subdirectory on seprate virtual directory using URL Rewrite v2 and Application Request Routing
For more detail please see here link

Legacy ASP site issue

I'm dealing with an issue where there was a site setup, and the default.htm used an iframe which pointed to an ASP directory. It seems like the ASP directory isn't readable and not processed - is there anything special that needs to be done to the ASP directory like permissions-wise?
wwwroot/sitename
<iframe src="ASP/file.asp"></iframe>
wwwroot/sitename/ASP/file.asp exists, and several other asp files but they aren't getting referenced by the iframe.
Update: I'm getting a 404..
The page cannot be found
I think I have to create a virtual directory and name it ASP. I never use IIS though - does anyone know how this works? And would I need to restart IIS after creating the virtual directory?
Update #2: More info..
Execute permissions: Scripts Only
Application name: asp
For Authentication Methods, "Integrated Windows authentication" is checked
Local Path: Read
Update #3: I can access asp/file.htm file fine. Can anyone provide code for a simple test I could do to see if its working properly ( I have no ASP/VBScript experience )..
one of the top of the pages contains <%# LANGUAGE="VBSCRIPT"%>
Is this IIS6 by any chance? In IIS, under Web Sites there is a folder called Web Service Extensions. Make sure Active Server Pages are set to Allow and not Prohibited!
When you create a virtual directory for an ASP site in IIS, you have to make sure it is allowed to execute scripts. What version of IIS are you using? In 5.0 and 6.0, there should be a checkbox Run Scripts (such as ASP). Make sure that's checked.
Try putting a test.html file in the root directory of the site and then try to open it through wwwroot/sitename/asp/test.html - .html files won't be processed by asp.dll and so should display if the site is setup correctly even if there is some kind of asp.dll problem.
If you can't see a html file then I guess you will need to configure the website in IIS (not sure if a virtual directory is necessary from the information given) - check the 'home' tab to see if the path to the application is correct first.
If you can see the html file then I'd guess that asp is not properly installed (but that is a guess).

I cannot access files in IIS 6

I have a default IIS 6 install and I can access only .html files. If I create a html file I can see it on the browser. Any other files like ini for example are not visible (404). Any idea on what can be the issue?
Check the web service extensions are enabled (in IIS below the websites is a folder for them) for the content you are trying to share.
Check that the handler mappings is setup correctly (on the website properties)
This may help :
IIS & ASP.NET blocking file

Resources