After npm run serve everything's working fine. After i deployed my app with API in ASP.NET application doesnt scale at all. I use Router and History. Authentication for annonymous users is enabled and static content is installed. Console doesn't show any errors.enter image description here
Links to screenshots:
Local run
IIS
What do you mean that vue.js not scaling? The second component display abnormally, is it right?
It might be something wrong with Javascript code snippets working.
Did you install the URL Rewrite extension in IIS and add the below rules in the webconfig file?
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.html" />
</rule>
</rules>
</rewrite>
Here is URL Rewrite extension.
https://www.iis.net/downloads/microsoft/url-rewrite
Related
I have question about Azure redirection.
I have searched other topics but not quite my problem(s).
I have ASP.NET Core 2.2 project and Azure configured for that. Also i have domain for pointing to Azure.
I have added www.example.com format domain to azure and that works fine also with https.
Problem rises with example.com format
I wanted to redirect example.com format to www.example.com URL
I manage to get this work with this, but for little while.
I use this web.config for redirection
web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<rewrite>
<rules>
<rule name="CanonicalHostNameRule" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example.com$" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Something strange is Google Chrome & Opera redirect(s) to www domain but not Edge and Firefox.
Then when i clear cache(s) then it wont redirect.
Seems like Azure like rewrites some over or something.
Thanks for help!!
In addition to the web.config file changes, ensure the Azure Website instance contains the correct domain bindings within the Hostname bindings area.
<rule name="Redirect to www">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^example.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent"/>
</rule>
I followed the Angular2 VS setup from this page-
https://angular.io/docs/ts/latest/cookbook/visual-studio-2015.html
The issue is that http://localhost:56428/ gives a 403 (forbidden) error, and the only way to access my index is to navigate to http://localhost:56428/src/index.html.
This is not ideal, and doesn't even work because requests to system.js and other files on this page go straight to the web root.
I'm not sure if I missed a step here but I don't think this is what they intended. How do I make src/ servable at /?
ANSWER FOUND AT
.net web application change root directory
I don't know why the angular site does not mention that.
Try to add base tag:
The tag specifies the base URL/target for all relative URLs in
a document
.
http://www.w3schools.com/tags/tag_base.asp
ANSWER FROM
.net web application change root directory
<configuration>
<system.web>
...
<urlMappings enabled="true">
<add url="~/" mappedUrl="~/src/index.html" />
</urlMappings>
</system.web>
...
<system.webServer>
...
<rewrite>
<rules>
<rule name="Redirect everything to root" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/src/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
...
</configuration>
Have you marked your index.html as application start up page?
If not, right click on index.html and click on "Set As Start Page".
I'm trying to edit my web.config with roadsunknown's code (from this post Remove HTML or ASPX Extension):
<rewrite>
<rules>
<rule name="RewriteASPX">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.aspx" />
</rule>
</rules>
</rewrite>
When I add the code I get the following error:
Warning 1 The element 'system.web' has invalid child element 'rewrite'.
I have IIS url rewrite 2.0 installed and have executed the script on this blog (http://blog.vanmeeuwen-online.nl/2013/04/visual-studio-2012-xml-intellisense-for.html) to update it for visual studio 2012. I don't know what else to do to get the web.config code to work.
I'd also be interested in an alternative method to remove the .aspx from my site's urls that doesn't involve IIS.
Not sure about your problem, other than it looks like the module isn't installed. Have you checked the modules section in IIS ?
You could use page routing instead. This describes how to use the page routing mechanism in a webforms app - http://msdn.microsoft.com/en-us/library/vstudio/dd329551(v=vs.100).aspx
I am trying to configure the silex framework and just get an example application working. I am using an IIS server version 7.5 to do so. On the following website it gives me a sample web.config file I should be using. The file is as follows:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Silex Front Controller" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
The problem is when trying to navigate to the website I just get the error:
The requested page cannot be accessed because the related
configuration data for the page is invalid.
So essentially IIS says the file is incorrect but I don't have much experience with these files so I don't know if there is a problem. Maybe the file is outdated and the newer doesn't work with newer versions of IIS. There is nothing in the server logs. Anyone come across this problem before?
Turns out I just needed to install the rewrite module for IIS at the following link:
http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module
I am using WordPress on Windows 7 IIS to develop. I am uploading images in WordPress for a blog post. The image displays fine on the web site but as soon as I enable permalinks the images no longer work and any future images uploaded I get back an error:
HTTP Error 500.50 - URL Rewrite Module Error.
The page cannot be displayed because an internal server error has occurred.
I am not sure why this would be happening, here is my web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
As soon as I turn off my permalinks and use the default it works, does anyone know why this could be?
The image issue was a permission issue, but simply setting it manually
on the original image file or parent folder is inadequate. The
behavior of WordPress is that it writes the original file using IUSR
to a temporary system directory that is defined in the PHP.ini file.
This temp folder does not have IIS_IUSRS permissions on it, so when
windows moves this file from the temp folder to the application's
upload folder, its final home, IIS_IUSRS only has read permissions, so
the permissions are not inherited from the file's parent folder.
To fix this, there are two solutions.
Change the permissions on the temp folder giving IIS_IUSRS write/modify.
Change the path of the temp folder in the PHP.ini file to a folder that does have IIS_IUSRS write/modify permission.
Here is a good source detailing the problem:
http://www.howyoudo.info/index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/
I chose to move the temp folder in my PHP.ini to
C:\inetpub\temp\uploads and also give it permissions. After uploading
an image in wp-admin, I was able to access the image (original, not
resized) from a browser wihout the 500.50 error.
From source
There's a slightly different web.config at Using Permalinks « WordPress Codex as well as other options for Permalinks without mod rewrite on Windows.
To help other users this issue is due to permissions in IIS and a fix is also here:
http://forums.iis.net/t/1159252.aspx
use this below mention RULEs in your web.config file ..
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^index\.php$" ignoreCase="false"/>
<action type="None"/>
</rule>
<rule name="Redirect Image to HTTP" stopProcessing="true">
<match url=".*\.(gif|jpg|jpeg|png|css|js)$" ignoreCase="true"/>
<action type="Rewrite" url="{R:0}"/>
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="." ignoreCase="false"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
</conditions>
<action type="Rewrite" url="/index.php"/>
</rule>