Could you please tell us which type of application you are using(like html,asp.net,php)?
Regards,
Jalpa.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
as you can see i am able to create rewrite rule without facing any error.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
You face same error when you try to run on powershell window?
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
could please tell us your operating system version(windows 10,server 2016)?
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
15 Posts
How to create new file config using cmd
Jan 15, 2019 10:02 AM|trongthai|LINK
I want to create a rewrite url in cmd but I don't have the web.config file yet.
Someone please help me.
1616 Posts
Re: How to create new file config using cmd
Jan 16, 2019 01:19 AM|Jalpa Panchal|LINK
Hi,
Could you please tell us which type of application you are using(like html,asp.net,php)?
Regards,
Jalpa.
15 Posts
Re: How to create new file config using cmd
Jan 16, 2019 01:22 AM|trongthai|LINK
Hi,
I am using php. Is this related to cmd?
1616 Posts
Re: How to create new file config using cmd
Jan 16, 2019 06:29 AM|Jalpa Panchal|LINK
hi,
No need to create web.config file in iis ,it will automatically create config file.
try below command:
Add-WebConfigurationProperty -pspath 'iis:\sites\php2' -filter "system.webServer/rewrite/rules" -name "." -value @{name='Redirect www.website.com' ;patternSyntax='Wildcard';stopPrcessing='True'}
15 Posts
Re: How to create new file config using cmd
Jan 16, 2019 08:23 AM|trongthai|LINK
I tried to use below command:
appcmd.exe set config "site1" -section:system.webServer/rewrite/rules /"[name='Redirect to HTTPS'].match.url:"(client*)""
But it reported an error:
The configuration section "system.webServer / rewrite / rules / [name = 'abc']. Match.url: (. *)" Is unknown. To display help, replace with?
1616 Posts
Re: How to create new file config using cmd
Jan 16, 2019 09:20 AM|Jalpa Panchal|LINK
Hi,
Try to access this command:
Add-WebConfigurationProperty -pspath 'iis:\sites\php2' -filter "system.webServer/rewrite/rules" -name "." -value @{name='Redirect www.website.com' ;patternSyntax='Wildcard';stopPrcessing='True'}
15 Posts
Re: How to create new file config using cmd
Jan 16, 2019 09:43 AM|trongthai|LINK
Error
Add-WebConfigurationProperty 'is an internal command or external command,
It is not recognized as an operable program or batch file.
1616 Posts
Re: How to create new file config using cmd
Jan 16, 2019 09:48 AM|Jalpa Panchal|LINK
How you run the command?
as you can see i am able to create rewrite rule without facing any error.
15 Posts
Re: How to create new file config using cmd
Jan 16, 2019 09:53 AM|trongthai|LINK
I copied your statement and just changed the site name and rule name.
http://prntscr.com/m7v1us
1616 Posts
Re: How to create new file config using cmd
Jan 17, 2019 01:40 AM|Jalpa Panchal|LINK
This is power-shell command. could you use power-shell ?
https://docs.microsoft.com/en-us/powershell/module/webadministration/add-webconfigurationproperty?view=win10-ps
15 Posts
Re: How to create new file config using cmd
Jan 17, 2019 01:58 AM|trongthai|LINK
I tried running the example on that page but it still received the same error as above.
1616 Posts
Re: How to create new file config using cmd
Jan 17, 2019 02:01 AM|Jalpa Panchal|LINK
You face same error when you try to run on powershell window?
15 Posts
Re: How to create new file config using cmd
Jan 17, 2019 02:03 AM|trongthai|LINK
Yes, It's like the error I sent you yesterday.
1616 Posts
Re: How to create new file config using cmd
Jan 17, 2019 02:05 AM|Jalpa Panchal|LINK
which version of os you are using?
15 Posts
Re: How to create new file config using cmd
Jan 17, 2019 02:07 AM|trongthai|LINK
I'm using IIS7
1616 Posts
Re: How to create new file config using cmd
Jan 17, 2019 05:14 AM|Jalpa Panchal|LINK
could please tell us your operating system version(windows 10,server 2016)?
15 Posts
Re: How to create new file config using cmd
Jan 17, 2019 06:41 AM|trongthai|LINK
I'm using windows server 2016
1616 Posts
Re: How to create new file config using cmd
Jan 17, 2019 06:51 AM|Jalpa Panchal|LINK
Click on search and type powershell and right click on it and select run as administator and open it.
Run this command:
Add-WebConfigurationProperty -pspath 'iis:\sites\php2' -filter "system.webServer/rewrite/rules" -name "." -value @{name='Redirect www.website.com' ;patternSyntax='Wildcard';stopPrcessing='True'}
15 Posts
Re: How to create new file config using cmd
Jan 17, 2019 06:54 AM|trongthai|LINK
Thank you somuch!
It worked.
Thanks again!
15 Posts
Re: How to create new file config using cmd
Jan 17, 2019 07:29 AM|trongthai|LINK
So if using powershell, what is the new web creation command?
I tried appcmd but got an error