• Resolved shvidky

    (@shvidky)


    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!

Viewing 15 replies - 1 through 15 (of 16 total)
  • 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.

    Thread Starter shvidky

    (@shvidky)

    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!

    Thread Starter shvidky

    (@shvidky)

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

    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.

    Thread Starter shvidky

    (@shvidky)

    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/

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

    I take it mod_rewrite is active and everything?

    Thread Starter shvidky

    (@shvidky)

    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.

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

    Thread Starter shvidky

    (@shvidky)

    Yes, default permalinks work without any issues.

    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.

    Thread Starter shvidky

    (@shvidky)

    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!

    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

    Thread Starter shvidky

    (@shvidky)

    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!

    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.

    Thread Starter shvidky

    (@shvidky)

    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.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Permalinks error, please help!’ is closed to new replies.