WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Permalinks error, please help! (17 posts)

  1. shvidky
    Member
    Posted 4 years ago #

    Hi guys,

    I have been stuck on this forever and really need your help. I am going crazy reading all possible solutions and I still can't change the permalinks to display my site.

    This is the message that i get:

    404 not found. The requested URL /wordpress/2010/01/28/test/ was not found on this server.

    Here is what I have done:

    1. Changed .htaccess file to this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    2. Made sure that file is re-writable by giving it 775 permissions.
    3. Made sure that index.php file has 775 permissions.

    I am hosting the site myself running Apache and MySQL. I really don't know what else to try. I would greatly appreciate your help. I am out of ideas. Thank you very much!

  2. Shane G.
    Member
    Posted 4 years ago #

    Hi,

    Reset your desired permalink from wordpress admin area and add this code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Now, check with posts and pages of your blog.

    Thanks,

    Shane G.

  3. shvidky
    Member
    Posted 4 years ago #

    Hi Shane,

    Thank you very much for your help. Sorry for my ignorance, when you say to add this code to htaccess? I replaced the text of my with yours and it is still giving me the same error. Should I have appended your code with mine?

    Thanks you very much!

  4. shvidky
    Member
    Posted 4 years ago #

    Anything else I can try? I really need this to work. I have been battling it for a long time. Really appreciate your help.

  5. alism
    Member
    Posted 4 years ago #

    Is WordPress index.php actually installed in that /wordpress/ folder? You perhaps need to just tweak your htaccess depending on your setup... eg...?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    # END WordPress

    You might want to post your site url.

  6. shvidky
    Member
    Posted 4 years ago #

    Great point, alism and thank you for trying to help!

    I did change it to /wordpress/ because you were absolutely correct that index.php is in /wordpress/ folder. However, it still didn't work :(

    Here is the URL: http://67.96.216.60/wordpress/

  7. alism
    Member
    Posted 4 years ago #

    Switch to the default permalinks, save, then switch back and save again. What happens?

    I take it mod_rewrite is active and everything?

  8. shvidky
    Member
    Posted 4 years ago #

    I tried switching it back and forth and no luck.

    How do I check if mod_rewrite is active? Sorry, I am really new to this.

  9. esmi
    Forum Moderator
    Posted 4 years ago #

    Try switching back to the default permalinks, saving and then deleting/renaming the .htaccess file and see if the default permalinks work.

  10. shvidky
    Member
    Posted 4 years ago #

    Yes, default permalinks work without any issues.

  11. alism
    Member
    Posted 4 years ago #

    Create a new text file called phpinfo.php, with the following line in it: <?php phpinfo(); ?> Upload it to your server and load the file in your browser, then look for 'mod_rewrite' in the output. Not foolproof, but hopefully straightforward. Or just ask your host. :-)

    You might also want to try adding:
    Options +FollowSymlinks
    into the top of your .htaccess file too.

  12. shvidky
    Member
    Posted 4 years ago #

    Alright, this is great! :) Learning something every minute. Looks like mod_rewrite is missing. I followed a guide on how to build a ubuntu server with wordpress and it didn't mention anything about mod_rewrite! :(

    So how do I install it? Just need to look up a command?

    EDIT: found the command: sudo a2enmod rewrite . Trying right now!

    Should I still add Options +FollowSymlinks to .htaccess?

    Thank you!

  13. alism
    Member
    Posted 4 years ago #

    Ah-ha. Well, sounds like a likely culprit to me. Will duck out of this thread now, as server setup isn't my strong point. Best of luck.

    (prob best to remove that phpinfo script from your server when you're done so you don't leak server config unnecessarily)

    added: have a read of this too by the way:
    http://codex.wordpress.org/Using_Permalinks#Fixing_Other_Issues

  14. shvidky
    Member
    Posted 4 years ago #

    Thank you very much for your help and the link. I am getting closer but still so far! For some reason, once in awhile, I find that my .htaccess file gets overwritten. I am not sure what is causing it, but I will try to go through the article you gave me.

    Thank you again!

  15. FightSarcoma
    Member
    Posted 4 years ago #

    Keep posting those who know this issue I am having the same problems with no fix in sight. It began a few upgrades ago, before which this never happened.

  16. shvidky
    Member
    Posted 4 years ago #

    OK, I fixed it!!! Thank you for everyone here for their help. I wouldn't be able to do this without you!

    Here is what I did:

    1. First of all I followed this great guide to build a Ubuntu server with LAMP(Linux, Apache, MySQL, and PHP): http://net.tutsplus.com/tutorials/php/how-to-setup-a-dedicated-web-server-for-free/

    2. Then, installed a few free tools to make things easier:
    http://net.tutsplus.com/tutorials/other/enhancing-your-ubuntu-server/

    These two tutorials are great and will get your going. With everyone's help here, I was able to get things going. Here is what you will need to do to fix the problem.

    3. Use your FTP client, right click on .htaccess and make sure that permissions are set to 775, same with index.php file. If both files are located in the wordpress folder, make sure to edit your .htaccess file as aslim suggested to this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    # END WordPress

    4. You will need to install the rewrite module in apache. Use command sudo a2enmod rewrite in ubuntu to add it.

    5. Log in to Webmin (you installed it in step 2, I have to use IE to get it in), click on Servers menu on the left, Apache Webserver. Click on Global Configuration tab. There you can do all kinds of tweaks to your webserver! Click on Configure Apache Server to make sure that rewrite module is checked there and it had been installed correctly in the previous step.

    6. Once you see it there, scroll down to Return to Server List and then click on Edit Config files.

    7. I have no idea what I am doing here but that seemed to fix it!
    In the drop down menu find /etc/apache2/httpd.config and hit edit.
    Paste this code there and hit Save:

    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>

    8. Then from a dropdown, choose /etc/apache2/sites-available/default
    and change AllowOverride from None to All everywhere you can find it. Then Save. Click Return to server list, up at the top right, hit Apply Changes, then Stop Apache, Start Apache and you are good to go.

    I have battled this issue forever and I hope that this post will save some people lots of time and frustration.

  17. haydenhancock
    Member
    Posted 4 years ago #

    @shvidky, GREAT POST. I have Ubuntu 10.04 LTS and did relatively the same thing. I didn't install Webmin until recently (makes it easier). But you can configure the proper files the same as you discussed. The only difference that in order to install Webmin, I had to install a dependency that wasn't listed in the nettuts tutorial (apt-show-versions).

    Thanks so much for your help though!

Topic Closed

This topic has been closed to new replies.

About this Topic