WordPress permalinks rewrite on iis7 - wordpress

I spend a lot of time in looking for solution, so you are my last hope before giving up :)
On my localhost iis7 i set custom permalinks http://sitename/%sample-post%/ with rewrite mode installed.
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="index.php"/>
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="WordPress: http://tip4u03" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule></rules>
</rewrite>
</system.webServer>
</configuration>
Its work only in wwwroot directory. Outside of wwwroot directory, its return 404 template page. Same issue on my shared iis7 server (VPS)

I solved the issue !!!
The problem was't with site location, it was because the permalinks are in Hebrew language. I added the following condition to wp-config file
if (isset($_SERVER['UNENCODED_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
}
according to this link: Wordpress Hebrew permalinks
Finally its work !

Related

How do I negate login.aspx in the web.config with Wordpress

We have recently created a Wordpress site which will be hosted on a Windows 2012 Server. The server is currently serving compiled code of which one of the URL's it uses is login.aspx.
When we add the Wordpress site and enable permalinks, we get the default Wordpress page instead of login.aspx.
We have unsurprisingly narrowed it down to the web.config rewrite rule.
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule>
</rules>
</rewrite>
I'm sure we have to negate the login.aspx page some how but I'm not sure how to do it. This has to work as a single site for now.
All I needed to do was add in the following:
<add input="{URL}" negate="true" pattern="*.aspx" />

How to remove index.php from url using web.config in iis server 8.0?

I have installed wordpress in iis server version 8.0. i have added custom structure in wordpress permalinks. server is not supporting permalinks. so i created web.config to remove index.php from the url.i cant able remove index.php. In root website i have web.config file. i have created another config file to remove the index.php from the url in the sub folder. its not working. Is there any solution to remove it.
website url: http://www.cyz.com/blog/index.php/links
to
url: http://www.cyz.com/blog/links
code in blog folder:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="blog/index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="WPurls" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="blog/index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

index.php shown up in every link

my problem is that my link shows (index.php) in every link like this
(www.mysite.com/index.php/postname)
and i want to show it like this
(www.mysite.com/postname)
but i want to remove that (index.php) from my links so how to do that?
i m using
(iis) 7.5 and (wordpress) 4.01
i try so many things but did not work so how to solve it?
and i cant also see web.config
but i can see (wp.config) so are they same?
You need to log into wordpress admin and go to permalinks and change
Custom Structure to: /%postname%/
Do not add the domain or index.php
if your'e running IIS you need to follow instructions on this link:
http://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite
or you can just
add web.config file to the root folder (where the WP install is) containing
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Then you can adjust your permalinks to your custom setup in the admin panel.

Trouble using Silex framework on IIS

I am trying to configure the silex framework and just get an example application working. I am using an IIS server version 7.5 to do so. On the following website it gives me a sample web.config file I should be using. The file is as follows:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Silex Front Controller" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
The problem is when trying to navigate to the website I just get the error:
The requested page cannot be accessed because the related
configuration data for the page is invalid.
So essentially IIS says the file is incorrect but I don't have much experience with these files so I don't know if there is a problem. Maybe the file is outdated and the newer doesn't work with newer versions of IIS. There is nothing in the server logs. Anyone come across this problem before?
Turns out I just needed to install the rewrite module for IIS at the following link:
http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

Wordpress Pretty Permalinks redirecting to home page on iis7

I have my WP site on iis7[Windows server 2008 R2];have explored a lot to find the right solution but nothing worked :(
http://cricketclips.net/late-overs-batting-flurry-from-luke-wright-pepsi-ipl-2013-kxip-vs-pw-match-29/
Added the following code to web.config in root
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?page_id={R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
but still it didn't work
My Url are being rewrite but are redirected to homepage instead of single.php and other pages ( that is index.php instead of single.php)
have checked the server for "FCGI" and "URL rewrite module", both are installed.
Any help in this regard will be appreciated.
This link helped me make my permlinks to work!
Just followed the steps
Changed the permalink structure to
http://example.com/index.php/%post_id%/%postname%/
Checked the result and voila! it was working...
Then changed the link back to
http://example.com/%post_id%/%postname%/
And happily ever after :)
You can Change the permalink setting from here
http://localhost/{your_projects_name}/wp-admin/options-permalink.php

Resources