I am using laravel 5.4 and deployed this to IIS 10.0.
The root route is not working on IIS but same is working fine for php artisan serve.
Below is my route:
Route::get('/', function () { return view('welcome'); });
Please reply what i need to change.
Thanks in advance.
Add this rule to your url_rewrite module, after that root route will start working.
<rule name="Index Request" enabled="true" stopProcessing="true">
<match url="^$" />
<action type="Redirect" url="index.php" logRewrittenUrl="true" />
</rule>
Let me know if my answer if helpful for you.
Related
I have the following website configuration on IIS 10.
<rewrite>
<rules>
<rule name="Rule1">
<match url=".*" />
<action type="Rewrite" url="https://www.google.com/{R:0}" />
</rule>
</rules>
</rewrite>
I'm trying to rewrite all the requests sent to mydomain.com to google.com (taken as an example)
When running the website, I'm getting the following google error page in the screenshot. Means the rewrite is not behaving properly and doesn't send requests to the domain www.google.com
Can anyone help please ?
Thanks. Regards,
I have .NET MVC application hosted on IIS 10 with the following URL:
https://abc-def-example.com/MyWebsite
I want to use https://abc-def-example.com instead of the above URL.
Note: MyWebsite is name of an application hosted on IIS
How do I achieve this?
Thanks in advance!
You can use the URL Rewrite Rule to rewrite the request on https://abc-def-example.com to https://abc-def-example.com/MyWebsite:
<rewrite>
<rules>
<rule name="Test">
<match url="^(?!MyWebsite)(.*)" />
<action type="Rewrite" url="/MyWebsite/{R:0}" />
</rule>
</rules>
</rewrite>
Apply this rule to https://abc-def-example.com.
I have hosted an Orchard site locally on my machine on IIS 8.0 using SQL LocalDb.
I have also installed and integrated the URL Rewrite module in IIS.
I have modified the web.config in the Orchard.Web project for redirecting as
<rewrite>
<rules>
<rule name="Redirect services to expertise" stopProcessing="true">
<match url="/services/(.*)" />
<action type="Redirect" url="/expertise/{R:1}" />
</rule>
</rules>
</rewrite>
So, what I intend to do is redirect from "http://localhost:70/Orchard/services/content-management" to "http://localhost:70/Orchard/expertise/content-management".
But this is not working as intended and there is no redirection. It opens up the same old "../services/.." URL.
Any Ideas?
Thanks in Advance.
I believe the issue is with your rule. The url does not have a leading slash. Try change the rule to:
<rule name="Redirect services to expertise" stopProcessing="true">
<match url="^services/(.*)" />
<action type="Redirect" url="expertise/{R:1}" />
</rule>
This will redirect any url starting with services/... to expertise/...
To configure an IIS rewrite rule to redirect traffic to my site to a different URL.
Basically I am trying to redirect this url: www.sharepointalex.co.uk to www.sharepointalex.co.uk/blog. At the moment it is pointing at the root of my site (a wedding website I setup for my partner and I).
www.sharepointalex.co.uk is a domain pointer on WinHost.
The rule I have so far is:
<rules>
<rule name="Blog" patternSyntax="ExactMatch" stopProcessing="true">
<match url="www.sharepointalex.co.uk" />
<action type="Redirect" url="{R:0}/blog" redirectType="Temporary" />
<conditions>
<add input="{HTTP_HOST}" pattern="www.sharepointalex.co.uk" />
</conditions>
</rule>
</rules>
However this doesnt seem to work.
Any help would be greatly appreciated.
Cheers
The match URL should not include the host name.
Hey there my redicret is not working and i don't understand why.
My rule looks like this :
<rewrite>
<rules>
<rule name="rewrite to article" stopProcessing="false">
<match url="^showfirm.asp\?rubrik=([_0-9a-z-]+)" />
<action type="Redirect" url="esbjerg/sog/?q={R:1}&t=" redirectType="Temporary" />
</rule>
</rules>
</rewrite>
When i try to match the url with
http://localhost/showfirm.asp?rubrik=sometexthere
I hit my custom 404 page, instead of hitting
http://localhost/esbjerg/sog/?q=sometexthere&t=
Anyone who can help ? Im using an IIS 7.5 with urlrewriter 2.0
Ps : First time doing an url redirect :)
Try this:
<match url="^showfirm\.asp\?rubrik=([_0-9a-z-]+)" />