Forum Moderators: open
I have ISAPI rewriter installed and have placed the following in the httpd.ini in the /wwwroot/ directory.
My blog located on domain.com/news
I had my host restart ISS for the changes to take effect but nothing works...
Here is the code I am using.
------------------
# Rules to redirectd domain.com to www.domain.com
RewriteCond Host: ^domain\.com
RewriteRule (.*) http\://www\.domain\.com$1 [I,RP]
# Rules to ensure that normal content gets through
RewriteRule /news/software-files/(.*) /news/software-files/$1 [L]
RewriteRule /news/images/(.*) /news/images/$1 [L]
RewriteRule /news/favicon.ico /news/favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /news/wp-(.*) /news/wp-$1 [L]
RewriteRule /news/xmlrpc.php /news/xmlrpc.php [L]
# For normal wordpress content, via index.php
RewriteRule ^/news/$ /news/index.php [L]
RewriteRule /news/(.*) /news/index.php/$1 [L]
--------------
The permalink structure I am using is simply %%postname%%
However all links to posts and categories 404.
The domain does not also redirect from domain.com to www.domain.com as it should.
Does anyone know is there something I am doing wrong or something that could be causeing the problem?
By giving permissions to everyone to you mean CHMOD 666 the http.ini file?
btw, you don't have to re-start the server. Simply upload the file into the correct location. Even if you make a change, just upload the new version of the httpd.ini file.
The file was in the right location and still did not work.
You said it was a windows server, i don't think you have CHMOD 666. On a windows server, if you right click on the file, you should see a security tab. Create a user "Everyone", and check "read" permissions.
Yes it is a Windows server. I did not realize it does not have a CHMOD option as I'm used to using Linux servers.
I am using Dreamweaver to upload and manage files, I cant see a security tab anywhere? How do I change the security settings?
Do you have an httpd.ini file at the root level of the server. You need the master .ini file installed at the root of the server and then you can install .ini files for each website on that server.
[ISAPI_Rewrite]
It should be:
[ISAPI_Rewrite]
# Rules to redirectd domain.com to www.domain.com
RewriteCond Host: ^domain\.com
RewriteRule (.*) http\://www\.domain\.com$1 [I,RP]
# Rules to ensure that normal content gets through
RewriteRule /news/software-files/(.*) /news/software-files/$1 [L]
RewriteRule /news/images/(.*) /news/images/$1 [L]
RewriteRule /news/favicon.ico /news/favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /news/wp-(.*) /news/wp-$1 [L]
RewriteRule /news/xmlrpc.php /news/xmlrpc.php [L]
# For normal wordpress content, via index.php
RewriteRule ^/news/$ /news/index.php [L]
RewriteRule /news/(.*) /news/index.php/$1 [L]
That has solved part of the problem.
The domain redirects from: domain.com to www.domain.com now as it should.
However the blog urls do not load properly.
The blog structure is:
[domain.com...]
this page loads clearly but links to individual posts and categories etc do not work.
Individual posts should be as below, but this 404s.
[domain.com...] title/
My settings in wordpress for permalink structure are simple: /%postname%/
I am following this guide: [basilv.com...]
You are telling the rewrite engine to serve the page /news/images/page1 with exacly the same page /news/images/page1
I don't get it
As mentioned before, try the isapi_rewrite forum
I am curious, probably adding the [ISAPI_Rewrite] part, correct?
I am not that good at writing rules, but your rules don't make sense. For example:
RewriteRule /news/images/(.*) /news/images/$1 [L]You are telling the rewrite engine to serve the page /news/images/page1 with exacly the same page /news/images/page1
I don't get it
As mentioned before, try the isapi_rewrite forum
I think it could possibly be to do with the php.ini file in the web root.
The php.ini file contains:
cgi.fix_pathinfo = 1
cgi.force_redirect = 0
The reason I beleive it is to do with the php.ini file is that it had no effect when I tried a different permalink structure with the wordpress blog, however this same permalink structure worked on an old server just fine with just the php.ini file (no Isapi rewrite).