WordPress.org

Ready to get started?Download WordPress

Forums

httpd rewriting for permalinks (20 posts)

  1. DrReaper
    Member
    Posted 3 years ago #

    Hi guys and gals,
    I am trying to figure out permalinks! Ouch...
    I have a windows 2003 server, the start of my problems. Mod rewrite seems much better but this is the world I live in. My server host game me a blank httpd.ini and it's up to me to make it work. I just want to blog.

    This is what works:
    http://gamersnews.com/news/?p=5

    This is what i want to work:
    http://gamersnews.com/news/rush-la-villa-strangiato/

    I am not sure how to write the code to make it happen.

    This is what I have in my httpd.ini and I am sure it's wrong.

    RewriteEngine on
    RewriteBase /
    
    #Exclude javascripts/stylesheets/images etc from rewriting
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    #Perform rewriting
    RewriteRule ^(.*)$ index.php?p=$1 [NC,L]

    Any help would be great.

  2. govpatel
    Member
    Posted 3 years ago #

    Try and install this plugin see if it solves your problem
    http://wordpress.org/extend/plugins/isapi-rewriter/

    keep us posted if it works so can help other window users.

  3. DrReaper
    Member
    Posted 3 years ago #

    Hi govpatel,

    Ok I got the plugin in place but it says I need to edit the .htaccess file. I don't have one. Does anyone know what directory it's supposed to be in?

  4. arkgroup
    Member
    Posted 3 years ago #

    DrReaper,

    Try to place .htaccess file into root folder of your wordpress.

  5. govpatel
    Member
    Posted 3 years ago #

    it is a hidden file allow hidden files to be seen

  6. DrReaper
    Member
    Posted 3 years ago #

    It didn't work. I am assuming the root would be the folder I installed wordpress into news.

    The server host provided me a httpd.ini file not a .htaccess file. I am not sure why. You would think someone ran into this problem before me. I am not reinventing the wheel here.

  7. arkgroup
    Member
    Posted 3 years ago #

    You need to create .htaccess file and place it into wordpress directory.

    Please make sure ISAPI Rewrite 3 installed on the server.

  8. arkgroup
    Member
    Posted 3 years ago #

    Or you may try to insert such code into your httpd.ini file:

    RewriteEngine On
    RewriteBase /news/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* /index.php [L]

  9. DrReaper
    Member
    Posted 3 years ago #

    My server company is on weekend support and they say we don't have ISAPI Rewrite 3 on the server but if I ad code to .htaccess it will work. I don't think they know what they are talking about.

    Anyway I am going to a BBQ so I will have to work on this later. Thanks for helping. I will be back to this later.

  10. DrReaper
    Member
    Posted 3 years ago #

    My .htaccess is in my news directory and it contains

    RewriteEngine On
    RewriteBase /news/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* /index.php [L]

    It doesn't work, i am not sure why.

  11. GRAQ
    Member
    Posted 3 years ago #

    I'm not really a windows or apache user much any more, but should it not hit the index.php in the install dir?

    That is, the last line should be: RewriteRule .* /news/index.php [L]

    Have you read up in the codex?
    http://codex.wordpress.org/Using_Permalinks

  12. arkgroup
    Member
    Posted 3 years ago #

    GRAQ,

    Yep, you're right.

    DrReaper,

    Try this one:

    RewriteEngine On
    RewriteBase /news/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /news/index.php [L]

  13. DrReaper
    Member
    Posted 3 years ago #

    I tried

    RewriteEngine On
    RewriteBase /news/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /news/index.php [L]

    and I tried

    RewriteEngine On
    RewriteBase /news/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* /news/index.php [L]

    They didn't work.

    When I setup the permalinks I took
    /index.php/%year%/%monthnum%/%day%/%postname%/

    Then I did a custom Custom Structure and removed the year, month, day, leaving just /%postname%/

    I am not sure if that is the reason it still isn't working.

  14. DrReaper
    Member
    Posted 3 years ago #

    Ok my server got back to me and they now tell me we have ISAPI_Rewrite version 2.0
    I guess this is the monkey wrench that has been in the machine.

  15. arkgroup
    Member
    Posted 3 years ago #

    DrReaper,

    May be something's wrong with isapi-rewrite. Try to make a simple rule and check whether it's working or not.

  16. DrReaper
    Member
    Posted 3 years ago #

    Hi Arkgroup,
    I know enough about coding to be dangerous. I don't know how to write a simple rule for ISAPI_Rewrite 2.0

  17. arkgroup
    Member
    Posted 3 years ago #

    Create b.html file, place it in the root folder of your website and insert any text there like:
    testing isapi rewrite

    Insert such lines into your httpd.ini
    RewriteEngine On
    RewriteRule ^a.html$ /b.html [L]

    Try to access: http://your-domain.com/a.html

  18. DrReaper
    Member
    Posted 3 years ago #

    It failed. I am going to open a ticket and see what my ISP says.

  19. DrReaper
    Member
    Posted 3 years ago #

    When setting up your rules for wordpress keep in mind that we use Isapi_Rewrite 2.0 from Helicon, the rules are different from those used in 3.0 which are more like Apache rewrites.

    [ISAPI_Rewrite] RewriteRule /a.html /b.html [L]

    The above code works. Now I need to apply it to wordpress. I am so clueless.

  20. arkgroup
    Member
    Posted 3 years ago #

    Yes, it looks like ISAPI_Rewrite 2 has different syntax:
    http://www.isapirewrite.com/docs/#RegexSynt

    They to ask the same question at their forum. I've searched and yet have not found any common solution for wordress and ISAPI_Rewrite 2.

Topic Closed

This topic has been closed to new replies.

About this Topic