net site on a shared hosted server with plesk as admin panel. And I want my 404 redirected to default page to handle extentionless urls
I have in the plesk panel pointed with url the following.
Error description type location
404 Not found Url http://iservice.iwebdesigner.org
however when I use the url like this http://iservice.iwebdesigner.org/user
it redirects to the default page but looses the /user. I believe the type which is not available on plesk needs to be set to execute url for iis. Is there a way of changing that in plesk? or what else can I do. I am not sure is web config settings can help as iis will have already redirected the page and the extension gone before web config settings can run.
The hosting people say the cant make any changes what so ever to iis.
Thanks
Ok I have figured it out. For those of you trying to use the urlrewriter module
in your shared hosted server. This rule below handles non existent extentionless
url and redirects to default.aspx for processing. e.g www.mysite/user. Once you
have set the 404 error page to point to the default.aspx as above in plesk(Type
must be url and the path set to default.aspx), upload the UrlRewritingNet.UrlRewriter.dll
to your bin folder. in web config
<configsections>
<section name="urlrewritingnet"`enter code here`
requirePermission ="false"
type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
</configsections>
<urlrewritingnet rewriteonlyvirtualurls="true" contextitemsprefix="QueryString" defaultpage="default.aspx"
defaultprovider="RegEx" xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>
<add name="ExtensionlessRewrite" virtualUrl="^~/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="/default.aspx" ignoreCase="true" />
</rewrites>
</urlrewritingnet>
<system.webserver>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</modules>
</system.webserver>
That worked for me echo
Related
I want to add re-write rules to my Azure app service, but if I even try create a web.config with a simple rewrite as shown below, the site returns an HTTP 500.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Test" stopProcessing="true">
<match url="test" />
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
What I did is create the web.config from scratch and FTP it into the wwwroot folder for the app service which is where I Ftp'd the rest of my web site files.
I have seen an old conversation about web.config files in Azure, but I'm not even sure if this is in regards to Azure app service - and things change so quickly in Azure that I thought I should ask separately anyways.
I have also seen this link about using web.config transforms. Maybe this is required?
This other link seems to indicate that updating web.config is possible, but their example results in an HTTP 500 for me as well.
I've looked through configuration options in the Azure portal for my app service and nothing seems to jump out at me.
>>”This other link seems to indicate that updating web.config is possible”
Yes, we could update the configuration of Web App by updating Web.config file directly. You could upload a new version of configuration file to wwwroot folder by FTP/WebDeply or any other ways provided by Kudu. Another easy way to edit files in wwwroot folder is using the App Service Editor, you could use it to edit the configuration file.
I can’t reproduce your problem on my side. Following are what I done.
Create a Web App using a Web App Plan with “Shared” SKU.
Create 2 file, a index.html file and a Web.config file. The content in Web.config is same as yours.
Upload these files to wwwroot folder of my web app using FTP.
Open a web browser and input a URL like this “http: // xxx.azurewebsites.net/test”. The web server will return the content of index.html. It proves that the rewrite is working fine.
>>”but their example results in an HTTP 500 for me as well.”
Firstly, please mark sure whether the rewrite is working fine or not. I suggest you view the index.html page directly and check whether the error code(500) comes from index.html page.
Sometimes we provide the wrong syntax for rewrite rule, it will return 500 (URL Rewrite Module Error). Have you enabled Detailed Error Logging and Web Server Logging for your web app. If yes, you could view the detail error message to get more useful information. For how to enable and view diagnostics logging, link below is for your reference.
Enable diagnostics logging for web apps in Azure App Service
I has a wordpress site on azure website, traditionally I has used Quick Redirect Plugin to redirect some pages to new pages, but this plugin not work on windows cuz is using web.config file instead .htaccess
There are any way to generate 301 redirects for certain page from wordpress when is hosted in windows server, I has searched some plugin to do this but not finded any.
MORE DETAILS:
Azure websites use subdomain for azurewebsites.net like myblog.azurewebsites.net, I am configure website url with other masking domain name and work well, but, I want to that when user browse myblog.azurewebsites.net/category/link redirect to www.mydomain.com/blog/category/link but with 301 redirect in web.config. I am traying several ways, with location and url rewrite but nothing work.
Example of rules used:
<rule name="CanonicalHostNameRule1" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="subdomain\.azurewebsites\.net/([_0-9a-z-/]+)" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" />
</rule>
Are you hosting your website with Project Nami?
Your wordpress site should still be using .htaccess, although I may be mistaken.
For redirection, I use Page Links To.
I'm using Umbraco 4.7 and I am trying to use the UrlRewriting.config file to set up a domain level URL redirect.
So for example, if a user hits the website at the following URL
www.OLD-Domain.com/join.aspx
I want rewrite the URL permanently to:
www.NEW-Domain.com/join.aspx
I'm hoping that the search engines will be able to see this too when they next visit the site to re-index it.
Examples/Ideas please?
If you don't want to use IIS redirects or sites to do this, then you can use an Umbraco config file to do the job for you:
Go to your "Config" directory in your main Umbraco website directory.
Edit the "URLRewriting.config" file in your favorite text editor.
Add the following code between the (paste here) tags:
<add name="SEOfix" virtualUrl="^http://domain.com/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="http://newdomain.com/$1" redirect="Domain" redirectMode="Permanent" ignoreCase="true" />
<add name="SEOfixSSL" virtualUrl="^https://domain.com/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="https://newdomain.com/$1" redirect="Domain" redirectMode="Permanent" ignoreCase="true" />
Save the file and test.
See more at: http://www.proworks.com/blog/2011/03/31/permanent-301-redirect-domaincom-to-wwwdomaincom-in-umbraco/
I have an ASP.Net 4.0 website hosted at winhost.com.
The default document is index.html. In the browser address bar, if I enter
http://www.mysite.com/index.html
it works fine - I get the index.html page as desired.
If, however, I simply enter http://www.mysite.com
the site behaves as if I have requested a page allowed only to authenticated users, that is, I am automatically redirected to the Login.aspx page.
Obviously this is a major panic! It means that the normal, public facing portion of the site is no longer visible unless visitors are instructed to include "index.html".
In IIS, I have verified that the "Default Document" is index.html, and it is first in the list.
In the web.config, I tried adding
<location path="index.html">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
But that did not help.
This all happened when I converted the site from 2.0 to 4.0. I was so busy fixing all the other problems (ajax security, wrong versions of dlls, etc.) that I never noticed this problem. Seems like it should be simple to fix, but I am stumped. Thanks for any help!
Check the NTFS permissions for the folder, where your website is located. And compare it with "index.htm" file permissions. Some user account must be missing.
I have a php Facebook application which I have uploaded in a Microsoft server. When I run the application i get this error. Does anybody know the cause of this ?
405 - HTTP verb used to access this page is not allowed. The page you
are looking for cannot be displayed because an invalid method (HTTP
verb) was used to attempt access.
Even if you are using IIS or apache, in my guess you are using static html page as a landing page, and by default the web server doesn't allow POST or GET verb on .html page, facebook calls your page via POST/GET verb
the solution would be to rename the page into .php or .aspx
and you should be good to go :)
In the Facebook app control panel make sure you have a forward slash on the end of any specified URL if you are only specifying a folder name
i.e.
Page Tab URL: http://mypagetabserver.com/custom_tab/
you can add these lines to the web.config:
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system.webServer>
It means litraly that, your trying to use the wrong http verb when accessing some http content. A lot of content on webservices you need to use a POST to consume. I suspect your trying to access the facebook API using the wrong http verb.
I fixed mine by adding these lines on my IIS webconfig.
<httpErrors>
<remove statusCode="405" subStatusCode="-1" />
<error statusCode="405" prefixLanguageFilePath="" path="/my-page.htm" responseMode="ExecuteURL" />
</httpErrors>
I've been pulling my hair out over this one for a couple of hours also. fakeartist appears correct though - I changed the file extension from .htm to .php and I can now see my page in Facebook! It also works if you change the extension to .aspx - perhaps it just needs to be a server side extension (I've not tried with .jsp).
Try renaming the default file. In my case, a recent move to IIS7.5 gave the 405 error. I changed index.aspx to default.aspx and it worked immediately for me.
In my case, IIS was fine but.. uh.. all the files in the folder except web.config had been deleted (a manual deployment half-done on a test site).
I got this error when I was using jquery and lib was not present in the given path, once jquery lib is added back error was gone.
[File name - calculate.html]
I had this err on the host too (my project was .net core2.1 webapi )
please add this code in web config in host :
<modules>
<remove name="WebDAVModule" />
</modules>