WordPress.org

Ready to get started?Download WordPress

Forums

urls do not contain .../index.php?... , but just .../?... (11 posts)

  1. sethmurphy
    Member
    Posted 8 years ago #

    I had my blog working on an Apache 2.0 web server, until I changed the default page in the directory to index.htm for production, instead of index.php. All links have /? instead of /index.php? that is needed to work if index.php is not the default page.
    Is there a simple way to insert index.php here?
    I looked at permalinks, and attempted some URL rewritting, all in vain.

    Thanks in advance,
    Seth

  2. caribou
    Member
    Posted 8 years ago #

    Hi,

    Funny, I have the same problem with my ISP. I have many installs of WP (1.5 or 2.0) on Linux/Apache2 on my home PC which all work fine. I just tried to use WP on my public ISP page, and all links that use the "{URL}/?" syntax (e.g. {URL}/?page_id=2 to display the "About" page) will not work.

    But if I replace {URL}/?page_id=2 bye {URL}/index.php?page_id=2 it all works fine. Is there a way to for the full filename to be used, or some specific setup on the apache server to be changed ?

    ...Caribou

  3. sethmurphy
    Member
    Posted 8 years ago #

    A simple fix would be to put index.php before index.html in the directory index in http.conf(or equivalent), or possibly delete any index.html files that exist.However, I wish to have index.html as the default page. If you do not, this may help.

    i.e.
    before:
    DirectoryIndex index.html index.html.var index.php

    after:
    DirectoryIndex index.php index.html index.html.var

    The server then passes the request to index.php, and the queery string parameters are parsed correctly.

    Seth

  4. sethmurphy
    Member
    Posted 8 years ago #

    Caribou,

    I came up with a wordpress based hack, but think there must be a better answer with Apache and URL rewritting.

    Here it is:
    in the file wp-includes/template-functions-links.php

    replace all '/?' with '/index.php?'

    This will break with an upgrade, but get's the job done.
    Looking at the code it is obvious there is no application setting that addresses this in particular, as this part of the link is hardcoded within hte particular functions.

    I hope this helps anyone with a similiar issue.

    Seth

  5. sethmurphy
    Member
    Posted 8 years ago #

    on second thought, that only fixes a few links ...

    also need to change in file:

    template-functions-category.php

    might be too many places to make changes cleanly.
    However, I am sure you get the idea.

    Doesw anyone out there know URL rewriting well enough to post an example to do this with Apache?

    Thanks in advance,

    Seth

  6. caribou
    Member
    Posted 8 years ago #

    Thanks for the info Seth.

    This might be what I'll need to do as I don't expect my ISP to change his server setup for me ;-)

    ...Caribou

  7. caribou
    Member
    Posted 8 years ago #

    One thing about Seth's brute force workaround is that it is a workaround, since a standard setup works fine on most of my Linux installs.

  8. technewsonline
    Member
    Posted 8 years ago #

    Why don't you try to use the nice permalinks in wordpress?

  9. sethmurphy
    Member
    Posted 8 years ago #

    Caribou is correct, my solution is not the answer I am looking for either.

    I tried to use the permalinks(which just create URL rewriting rules) with no success. Any advice would be appreciated. I will be using them anyhow in order to optimise for SEO.

    Thanks,
    Seth

  10. Why not use the /index.php/permalink/here rules?

  11. caribou
    Member
    Posted 8 years ago #

    Hi,

    Took me a while to come back to this.

    It seems that I cannot use the permalink feature since my two cents provider doesn't support mod_rewrite.

    As Seth indicated, I would like to know if there is a way to keep WP from using the {URL}/?page_id or syntax like this, i.e. just dropping the index.php filename ?

Topic Closed

This topic has been closed to new replies.

About this Topic