WordPress.org

Ready to get started?Download WordPress

Forums

*sighs* Permalinks (20 posts)

  1. carnold
    Member
    Posted 8 years ago #

    OK, i could not get permalinks working in WP 2.0. So, i searched wordpress.org and found someone that upgraded to WP 2.01 and then immediately activated permalinks and he got it working (without the /index.php being shown in the browser). So, i upgraded to WP 2.01 and tried permalinks, no workie (/index.php is always shown=works). I use apache2 with php4 and mysql4. I have read conflicting posts where WP 2.0 does not use mod_rewrite? I run tghis linux box myself and have full access to it. I also have a .htaccess file (that is writeable) and adding the *begin wordpress jargon to it does not work. I would like my link format like this: http://www.domain.here/contact and /faq and so on. The index.php always shows and if i change it to what i want, i get a 404 error. Can anyone help?

  2. Direkt
    Member
    Posted 8 years ago #

    First off, I'm sure you have mod_rewrite on. But, you need to scroll down in the httpd.conf and change the AllowOverride option to All. This should work, if not, tell me.

  3. carnold
    Member
    Posted 8 years ago #

    Same thing happens (index.php shows). I am selecting Numeric
    » http://www.mytimewithgod.net/index.php/archives/123 in "permalinks". This also populates "custom" (which is under "numeric") with the same entry. I also have tried Date and name based
    » http://www.mytimewithgod.net/index.php/2006/02/17/sample-post/, same thing happens (index.php shows). Thanks for any help, Direkt
    *EDIT/ Oh, i have also tried "custom" /index.php/archives/%post_id% (both with the /index.php and without /index.php)/*EDIT

  4. Chris_K
    Member
    Posted 8 years ago #

    Direkt is probably on the right track. I'd like to suggest you have another go at it: Search through the httpd.conf for AllowOveride and set to ALL - for the proper directory that hosts your blog! If you search the conf, you'll find AllowOveride in several spots.

    Then restart the httpd service.

    And, for permalinks, do not include "index.php" if doing custom as that would defeat your goal.

  5. carnold
    Member
    Posted 8 years ago #

    I only find 1 instance of AllowOverride ALL in my httpd file. And it is set to ALL. This file is found in my /etc/apache2 folder. That is what i am trying to do, not include /index.php.

  6. Chris_K
    Member
    Posted 8 years ago #

    Few questions:

    you've restarted httpd?

    Do you have link to your site?

    What is currently in your .htaccess?

  7. carnold
    Member
    Posted 8 years ago #

    Yes, restarted a few times.
    http://www.mytimewithgod.net
    When i first started to get permalinks working, nothing was in there but this:
    PHP_FLAG output_buffering On (this is in there so i could use an ajax theme from bloxpress)
    Then, after searching here for permalinks problems, i found others that were saying their htaccess file had this in it:
    #BEGIN WorPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME !-f
    RewriteCond %{REQUEST_FILENAME !-d
    RewriteRule . /index.php
    </IfModule>
    #END WordPress
    Just for clarification, i entered this into the htaccess file myself. Because i read conflicting posts, here, that WP 2.0 and up did not use mod_rewrite. I also searched my software for "apache" and "mod_rewrite", not found. I am not sure that mod_rewrite is installed (unless it installs by default with apache2). Thanks again

  8. Chris_K
    Member
    Posted 8 years ago #

    ... and I'm not bright enough to know if you "need" mod_rewrite for wp2.x, but I'd start by heading back to the httpd.conf and seeing if it is loaded. Look for a line like:
    LoadModule rewrite_module modules/mod_rewrite.so

    As long as there's not a # in front, it should be loaded. Suppose you could make a little .php page with only phpinfo() in it and check that way too.

    Apache on *nix or windows?

    (this is hard! On my stuff I just jump on the box and start poking around. Trying to do this methodically means I have to think more... hopefully someone bright will show up soon...

    For what it's worth, I fought this battle a couple months ago, but got it fixed with AllowOverride)

  9. carnold
    Member
    Posted 8 years ago #

    Nope, it does not look like it is loaded (if needed). Both a search through httpd produced no refeence of mod_rewrite and my phpinfo file also does not produce any reference of mod_rewrite. I am thinking, it DOES need to be loaded to use permalinks. Sorry, it is apache2 on Linux SLES9 (novell distro). Are you running Linux? If so, do you mind telling me how you got mod_rewrite installed. This distro uses a package manager called red carpet, and i can not find any reference of mod_rewrite using red carpet or yast. Where in your httpd file does your mod_rewrite appear? Thanks again for the help, you have answered many questions!
    */EDIT...Yep, it IS installed (by default) and is found in /usr/lib/mod_rewrite.so. But the weird thing is, no reference of it is found in the httpd file. I wonder if i make an entry in the httpd file, will this work?...EDIT*/

  10. Chris_K
    Member
    Posted 8 years ago #

    I'm running fedora core 4. Installed and loaded by default. I'd go ahead and add it to your LoadModule section and restart and see what happens.

  11. carnold
    Member
    Posted 8 years ago #

    Well, i got a little further :) Seems novell has done some modifications to this distro. There isn't a section in httpd of LoadModule; this section says include /etc.sysconfig.d/LoadModule and this file has the LoadModules inside it. Also this file refers to /etc/sysconfig/apache2 where you also insert the mod_rewrite.so file along with its file path. So now, all entries in the WP admin panel are now missing the /index.php/blah/blah. It simply has /blah/blah, no index.php. And it still does not work and to get it back to working state, i must select the default permalink format. Like i said, got some where but not working with custom permalinks

  12. carnold
    Member
    Posted 8 years ago #

    OK, here are the weird apache2 files:
    httpd file:
    # generated from APACHE_MODULES in /etc/sysconfig/apache2
    Include /etc/apache2/sysconfig.d/loadmodule.conf

    loadmodule.conf file:
    # as listed in APACHE_MODULES (/etc/sysconfig/apache2)

    LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so
    LoadModule suexec_module /usr/lib/apache2-prefork/mod_suexec.so
    LoadModule access_module /usr/lib/apache2-prefork/mod_access.so
    LoadModule actions_module /usr/lib/apache2-prefork/mod_actions.so
    LoadModule alias_module /usr/lib/apache2-prefork/mod_alias.so
    LoadModule auth_module /usr/lib/apache2-prefork/mod_auth.so
    LoadModule auth_dbm_module /usr/lib/apache2-prefork/mod_auth_dbm.so
    LoadModule autoindex_module /usr/lib/apache2-prefork/mod_autoindex.so
    LoadModule cgi_module /usr/lib/apache2-prefork/mod_cgi.so
    LoadModule dir_module /usr/lib/apache2-prefork/mod_dir.so
    LoadModule env_module /usr/lib/apache2-prefork/mod_env.so
    LoadModule expires_module /usr/lib/apache2-prefork/mod_expires.so
    LoadModule include_module /usr/lib/apache2-prefork/mod_include.so
    LoadModule log_config_module /usr/lib/apache2-prefork/mod_log_config.so
    LoadModule mime_module /usr/lib/apache2-prefork/mod_mime.so
    LoadModule negotiation_module /usr/lib/apache2-prefork/mod_negotiation.so
    LoadModule setenvif_module /usr/lib/apache2-prefork/mod_setenvif.so
    LoadModule userdir_module /usr/lib/apache2-prefork/mod_userdir.so
    LoadModule ssl_module /usr/lib/apache2-prefork/mod_ssl.so
    LoadModule php4_module /usr/lib/apache2-prefork/libphp4.so
    LoadModule jk_module /usr/lib/apache2/mod_jk.so
    #
    Apache2 file:
    # APACHE_MODULES="access actions alias asis auth autoindex cgi dir imap include log_config mime negotiation setenvif status userdir"
    # your settings
    APACHE_MODULES=" rewrite suexec access actions alias auth auth_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif userdir ssl php4 jk"

    Can anyone help?

  13. carnold
    Member
    Posted 8 years ago #

    OK, got mod_rewrite verified as loaded and restarted apache2. Still can not get permalinks working. Now, looking at the htaccess file, it was exactly like this:
    #BEGIN WorPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME !-f
    RewriteCond %{REQUEST_FILENAME !-d
    RewriteRule . /index.php
    </IfModule>
    #END WordPress
    Now, when updating permalink structure, it looks like this:
    #BEGIN WorPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME !-f
    RewriteCond %{REQUEST_FILENAME !-d
    RewriteRule . /index.php
    </IfModule>

    #END WordPress
    Notice the white space at the end. So, i know this file is getting written to because of the change. Problem is, i also read here on the forums, that the white space is not good and will cause it not to work. Any ideas?

  14. Chris_K
    Member
    Posted 8 years ago #

    Boy.... I'm stumped, personally.

    That space before "#END WordPress" is in my .htaccess as well and doesn't seem to harm anything.

    I went to have a look at your site, but right now you must have it set to "Default" for permalinks.

  15. carnold
    Member
    Posted 8 years ago #

    Good to know that someone else has the white space and it works. I do have it set for default now but can set it to the other if you would like to test drive it?
    Edit..Set to numeric for testing. Let me know...Edit

  16. Chris_K
    Member
    Posted 8 years ago #

  17. Chris_K
    Member
    Posted 8 years ago #

    Oh - and, anything of interested being generated in your apache error logs? (mine are at /var/log/httpd, but not sure where yours would be).

  18. carnold
    Member
    Posted 8 years ago #

    Well, at a total loss now. Tried everything on the link to the codex you posted (again)->still broke. No errors in the apache log that stand out. Tried 1 other thing as that was to add different rewrite rules (manually) and this did not work either. Confused!

  19. Chris_K
    Member
    Posted 8 years ago #

    so, do ANY rewrite rules in .htaccess work?

    Maybe try and put one like this at your top level directory:

    RewriteEngine on
    RewriteRule ^blogx/*$ /blog/ [R=301,L]

    Then, try and browse to yourdomain.com/blogx and see if it switches you to /blog (or adapt to fit your directories)? At least then we'd know if rewrite is working... Ideally, you'd see that in the apache logs too.

  20. daiko
    Member
    Posted 7 years ago #

    I had the same problem with a fresh installation of LAMP on Fedora Core 5, but the sollution was in the link above from HandySolo:

    AllowOverride Not Enabled
    Your server may not have the AllowOverride directive enabled. If the AllowOverride directive is set to None in your Apache httpd.config file, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem. When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files. Example of enabled AllowOverride directive in httpd.config:

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

    Thank's to you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.