Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Is there a trick to rewriting home directory only?

$
0
0

During the process of some experimental hardening of wordpress I've run into a slight problem with how it handles the URLs of post previews. The solution, I thought, would be easy enough: create a rewrite rule to append 

index.php
 to the post preview URL so it doesn't default to the homepage. However everything I try either has odd results or generates in a system 500 error. Is there a regular expression to solve this I haven't learned yet?
<rule name="Post preview fix" patternSyntax="ECMAScript"><match url="^\?p=([0-9]+)&preview=true$" /><action type="Rewrite" url="index.php
?p={R:1}&preview=true" /></rule>

I am only having this problem with new post previews. Revision previews are working just fine, probably because the rules are slightly different.

This behavior is being caused by the homepage rewrite, which looks like this:

<rule name="Homepage rewrite" patternSyntax="ECMAScript"><match url="^/?$" /><action type="Rewrite" url="home/index.aspx" /></rule>

When I remove this rule, post previews work fine, but the homepage url displays it's literal path. Perhaps this problem could also be solved by a better way to spoof the location of the homepage?

ugh. All because of this legacy asp web app vs new php cms garbage. Just kill me now.

At any rate, if someone has a silver bullet to share I would be eternally grateful. 



Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>