Forums

[resolved] Broken links index.php is not included (6 posts)

  1. rpiontek
    Member
    Posted 6 years ago #

    Many of the links on my main page are broken. For instance, the link to the uncategorized posts points to /localhost/wordpress/?cat=1, which ends up just lising the contents of the /wordpress/ directory. If I type in /localhost/wordpress/index.php?cat=1 it shows me the uncategorized posts like it should. From my seach, I found that maybe I need to update something in Options->Permalinks, but when I go there I get an Apache error an nothing is displayed for the permalinks. Is this what I need to be looking at, or is it something else?

  2. petit
    Member
    Posted 6 years ago #

    1. Do you have the index.php file in your <yoursite>/wordpress directory ( I assume the name of the installation directory is wordpress ). If not, the installation went wrong.

    2. If your links contain localhost, we must assume that you installed WordPress o your own computer and only wants to reach your blog from that very maschine ( i.e. talking to yourself :-)

    3. If 2 is correct the pages are served over a web server on your local machine. The web server needs to be configured to serve up index.php as one of the possible default pages.

    If this information doesn't help, please tell us what system and web server you use and where that server is.

  3. rpiontek
    Member
    Posted 6 years ago #

    Yes, my index.php file is in http://localhost/wordpress/index.php. Yes, I am trying to install on my local machine, and simply want to view the page myself. I'm on Windows XP, running Apache (not sure what version at the moment). The wordpress directory is located someting like this relative to where apache is installed: /apache/htdocs/wordpress.

    I've looked around and it seems maybe I need to create a .htaccess file as there isn't in the wordpress directory? I actually tried this last night, but Windows wouldn't let me rename a file to .anything!

  4. petit
    Member
    Posted 6 years ago #

    I don't think you need any .htaccess file. This is for URL rewrite to get nice permalinks.

    What you need though is ...

    "The web server needs to be configured to serve up index.php as one of the possible default pages."

    This means that you should edit the httpd.conf file in your Apache installation so it accepts index.php as a default index page.
    The relevant section in http.conf may look like this:
    <IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml
    </IfModule>

    Just add index.php to the end of this list
    DirectoryIndex index.html index.htm index.shtml index.php

  5. rpiontek
    Member
    Posted 6 years ago #

    Thank you! That fixed all of my links except for 2. The main header image shows that it links to http://localhost/wordpress/, but when I click it the browser trys to go to somenet.com (literally). The interesting thing is that if I'm at the dashboard admin page the "View Site" link at the top also shows that it links to http://localhost/wordpress/, but this link is followed to my correct page. Hmmm? My other problem is with the Photos link to my gallery page, but I found some suggestions for that.

  6. rpiontek
    Member
    Posted 6 years ago #

    Well, I solved my troubles, but it was more of a workaround. What I ended up doing was moving the wordpress index.php and wp-gallery2.php to the root of my site, whereas before they were in /wordpress. Then in the wordpress admin panel I went to options -> general and changed the wordpress url to http://www.mypage.com/wordpress and the blog address to http://www.mypage.com. now everything is good. there may have been a couple of other steps, so for some other posts about changing these options before you do it. if you screw up, as I once did, it can be a bit of a pain to recover from.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.