Forums

[resolved] Permalinks making me lose my mind (5 posts)

  1. ashrk
    Member
    Posted 9 months ago #

    Hello all. I've been messing with this for way too long and I may have gone officially insane. I've been trying to use 'pretty' permalinks. When I insert the code that WordPress supplies after I update the permalink structure into my web.config file, I get a 500 (internal server) error. When I insert the code given in the "Using Permalinks" WordPress codex, I get a 404 error when I try to access my pages. Either way, it's a no-go. My brain hurts. Can anyone tell me how to make this work? Pretty please? :)

    If it helps, the code given when I update the permalinks structure is as follows:

    <configuration>
    	<system.webServer>
    		<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>
    	</system.webServer>
    </configuration>

    This is the one that causes the 500 (internal server) error.

    This is the code given in the referenced WordPress codex, the one that causes the 404 error:

    <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/{R:0}" />
            </rule>
        </rules>
    </rewrite>
  2. Marventus
    Member
    Posted 9 months ago #

    Hi Ash,

    You need to use the second code you provided. Usually, when you change your Permalinks structure, WordPress rewrites all your post links to make them work with the new structure.
    So if you chose any of the options that include the post name, make sure your posts' links got updated as well by going in WP Admin Page --> Post Editing.
    If, for some strange reason, your post links are not to the right URL and you have A LOT of them, try resetting the Permalink structure to default and then back to pretty again to force WP to update them.
    If that still doesn't work, you will have to update each post's url manually.

    Good luck!

  3. Marventus
    Member
    Posted 9 months ago #

    Hi,

    Were you able to solve your Permalinks issue?
    If so, could you please mark this thread as resolved?

    Thanks!

  4. ashrk
    Member
    Posted 9 months ago #

    It turned out that I didn't have multi-site enabled, and that was causing the permalinks issue. The site that I was having the problem with was installed in a subdirectory. Always the simple things that get ya!

  5. Marventus
    Member
    Posted 9 months ago #

    Great to know it is working now.
    The little things indeed, ;-)

Reply

You must log in to post.

About this Topic