Wordpress URL rewrite

Topics: Developer Forum
Sep 2, 2008 at 2:53 PM
I have wordpress installation in root directory. In IsapiRewrite4.ini I have this:
cgi.fix_pathinfo = 1
cgi.force_redirect = 0
RewriteRule ^/(?!index.php)(?!wp-)(.*)$ /index.php/$1

In wordpress under Permalink  I have Custom structure:  /%postname%/
and I see url for pages like this: http://mydomain.com/contact/  But in contact page I have e-mail form. When the fields are empty and You click submit, it shows 'Please, fill the form.'..  URL for this page is: http://mydomain.com/wp-content/themes/myTheme/skriptaEng.php It looks the same like the other pages, but it is static page. I want to rewrite this static url to dynamic url, something like this: http://mydomain.com/contact/missingField/ and hide a static url.
Does anybody know what should be RewriteRule to convert static page http://mydomain.com/wp-content/themes/myTheme/skriptaEng.php to http://mydomain.com/contact/missingField/
Thanks
Tanja
Coordinator
Sep 3, 2008 at 8:41 PM

I don't know what you expect to happen with cgi.force_redirect = 0

that is not interpreted by IIRF.  I'm not sure what you want to do with it.

Also I don't understand the question you are asking. 

Does anybody know what should be RewriteRule to convert static page http://mydomain.com/wp-content/themes/myTheme/skriptaEng.php to http://mydomain.com/contact/missingField/

It's not clear to me what you mean by "convert". IIRF is a URL rewriter. It rewrites URLs. When you say convert from X to Y, do you mean rewrite X to Y, or do you mean rewrite Y to X? The following rule rewrites http://mydomain.com/wp-content/themes/myTheme/skriptaEng.php to http://mydomain.com/contact/missingField/ .

RewriteRule   /wp-content/themes/myTheme/skriptaEng.php    /contact/missingField/ 

Please check the readme.

Sep 3, 2008 at 9:03 PM
Thanks for reply, but this is not working with this magic line: RewriteRule ^/(?!index.php)(?!wp-)(.*)$ /index.php/$1 , which is from this tutorial: http://waltersmith.us/blog/2005/12/.
See what you get: http://artkalma.com/contact/missingField/ , not found.

Some RewriteCond is missing, like I added this mornig for my sitemap :
RewriteCond %{REQUEST_URI} \sitemap.xml$ http://artkalma.com/sitemap.xml$

Tanja

Coordinator
Sep 3, 2008 at 9:40 PM

I'm sorry, I have no idea what you are asking me at this point.

Maybe the way to go is this: provide answers to the following questions:

  1. What results do you expect to see?
  2. What results are you actually seeing?

When answering these questions, you will have to focus your comments on IIRF. I'm really very sorry, but I don't know wordpress, so I cannot help you there. If you ask me "how do I get IIRF to work with wordpress?" I have no idea. I don't have a good answer for that. I know how to get IIRF to rewrite URLs. I don't know anything else.

 Also, you need to provide specific examples.  Eg, in answering Q1, "what results do you see?"  tell me something like this:
"I submit this URL through the browser (http://xxx/foo/bar/baz) and in the logfile, I see it is rewritten to (/wah/grata/eerf) ."

In answering Q2 above, tell me something like this:
"I expect to see that URL rewritten to (/fhoo/bhar/bhah) "