Could you please tell us which type of application you are using(like html,asp.net,php)?
Regards,
Jalpa.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
as you can see i am able to create rewrite rule without facing any error.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
You face same error when you try to run on powershell window?
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
could please tell us your operating system version(windows 10,server 2016)?
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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.
964 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.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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?
964 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'}
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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?
964 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'}
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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.
964 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.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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
964 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
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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.
964 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?
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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.
964 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?
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
15 Posts
Re: How to create new file config using cmd
Jan 17, 2019 02:07 AM|trongthai|LINK
I'm using IIS7
964 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)?
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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
964 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'}
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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