5
Contributors
11
Replies
33
Views
3 Years
Discussion Span
Last Post by pritaeas
Featured Replies
1

You can try this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Serve PHP files sans ext" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}.php" matchType="IsFile" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="{R:1}.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
0

@cilla yeah it is working . thank you so much sir.... u given complete code . thank you so much again ...

0

@cilla
sir i was tried your example
http://example.com/files.php which rewrites http://example.com/files
ok fine

i added the following line for directory (like this http://example.com/files/ ) but am not getting can you help me
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

 <configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Serve PHP files sans ext" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}.php" matchType="IsFile" ignoreCase="false" />

<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
0

sir , htaccess is not supporting my server thats why using web.config (windows hosting)

0

@raj. i apologize if my post was a little curt but i'm on bacation and im using a mobile so i was just trying to point you in the right direction. complete code solutions aren't really what this site is about though. we did not know that you were on iis so its a good thing that i didnt waste 10 minutes of my time typing out a htacces solution.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.