WordPress.org

Ready to get started?Download WordPress

Forums

Extra forward slash added causing pages to break (10 posts)

  1. jerrywin5
    Member
    Posted 7 years ago #

    WP is creating links like the following:
    http://firemanfred.com/journal.php/?p=1

    Notice the / before the ?. If I click on such a link, the page breaks (the bottom part of the page does not load and the css breaks). If I remove this / and reload the page, it loads just fine.

    How can I resolve this problem?

    I am using Dreamhost and used the one-click install. I installed WP in a directory (wordpress) and moved the index.php file to the domain root snd renamed it. I changed the Blog address in the admin to reflect this. I am not using permalinks.

  2. gavinholt
    Member
    Posted 7 years ago #

    most likely it is your htacess file that is messed up. try different setups (with and without mod_rewrite) to see if you can get it to work. Also, you may have setup a custom style that adds the / while the server (usually via mod_rewrite) is doing it without the /.

  3. jerrywin5
    Member
    Posted 7 years ago #

    I do not have an htaccess file.

    In the admin under Options|Permalinks, the default option reads: http://firemanfred.com/journal.php/?p=123

    This leads me to think that somewhere in WP the extra / is being added. I have been looking through the files and I cannot find it. I have confirmed that it isn't happening in via the template theme. What do you mean by custom style?

  4. gavinholt
    Member
    Posted 7 years ago #

    Try creating a .htaccess file using the code provided in options->permalinks. Try the different options (like date and name or numberic) to see if it changes the situation. By custom style, I meant tlike this:

    http://www.gavinphotography.com/blog/2006-11-14-a-slideshow-of-judy-and-me/

    where if you look at the link it uses this:

    /%year%-%monthnum%-%day%-%postname%/

    under the custom option in permalinks

  5. Chris_K
    Member
    Posted 7 years ago #

    default permalink structure = no .htaccess file necessary.

    Is the webserver configured to recognize index.php as a default page?

  6. gavinholt
    Member
    Posted 7 years ago #

    Yeah, I was hoping you changed from the default it might eliminate the problem (since there is no index.php anymore).

    Your server sets that up (depends on the server). Usually you can find options on what order to load (index.htm->index.html->index.php and so forth). index.php should be in there by default, but you should check with whoever hosts your server.

  7. vkaryl
    Member
    Posted 7 years ago #

    Er.... why if changing from default would you think there would no longer be an index.php? Every theme includes an index.php, as well as the normally resident root index.php.

  8. gavinholt
    Member
    Posted 7 years ago #

    no, the mod_rewrite eliminates index.php from the address, leaving on slashes at the end (like an open directory). For example, you can see this page:

    http://www.gavinphotography.com/blog/

    with the index.php hidden from the address. It exists, yes, but the address doesn't need to show it. This link here:

    http://www.gavinphotography.com/blog/2006-10-13-welcome-to-the-official-blog-of-gavin-photography/

    Shows the article at a directory (that only exists virtually. The actual link would be something like this link:

    http://www.gavinphotography.com/blog/index.php/?p=3

    understand these two links ARE THE SAME, and mod_rewrite turns the index.php?p=3 link into something easier for people to read (it's just plain sexier). Try that and it might help.

  9. vkaryl
    Member
    Posted 7 years ago #

    Oh. Pretty silly.... who on earth cares? Not google....

  10. gavinholt
    Member
    Posted 7 years ago #

    It actually does help with Google. It places keywords into the link, which aides in the results (you'll see them bolded in your results). Plus it makes it easier to to read. There is a large following of people that use mod_rewrite to make their websites better, such as online stores that have product names in the URL instead of index.php?product_id=12345

    I admit it is a bunch of work to get it to work, but you can weigh out whether it is worth your time. To me, it matters for my websites, so I spend the extra time.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags