0

I have a website which i made in php and i host it in a linux shared hosting . Now for some purpose i uploaded this site to windows dedicated server.Everything works fine except the htaccess rules which i wrote not working and i am getting 404 error(The requested path not found in server). I found some articles get to know i have to convert htaccess to web.config file. The htaccess i am using inside a folder and i have no idea where should i put the web.config file

RewriteRule    ^([a-zA-Z0-9-]*)?$       index.php?PG=$1

This rule is inside a folder.

Bill P
  • 3,571
  • 10
  • 16
  • 28
  • Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](https://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – Masivuye Cokile Oct 01 '19 at 13:00

1 Answers1

0

You can try with this code:

<rewrite>
    <rule name="rule 1A">
        <match url="^([a-zA-Z0-9-]*)?$" />
        <action type="Rewrite" url="/index.php?PG={R:1}" />
    </rule>
</rewrite>

And save in web.config

Stefano Pascazi
  • 341
  • 1
  • 10