The MU forums have moved to WordPress.org

mod_rewrite problem (14 posts)

  1. bosal
    Member
    Posted 16 years ago #

    I have a big problem. When I set the orginal mod_rewrite syntax... i get a info when restarting httpd:

    RewriteBase: only valid in per-directory config files

    When i delete this line:

    RewriteBase /

    It doen't work good.
    How to write the mod_rewrite without this line ?

  2. bosal
    Member
    Posted 16 years ago #

    or if it's imposibble, how to disable fancy URL's and have page.com/?p=1234

  3. drmiketemp
    Member
    Posted 16 years ago #

    Per the readme file included with the download:

    http://trac.mu.wordpress.org/wiki/DebuggingWpmu

    Please define "It doesn't work" Are you getting specific errors? What are the errors? What's in the error logs? Which install do you have - subdirectory or subdomain

    The RewriteBase line should be in there.

  4. bosal
    Member
    Posted 16 years ago #

    Yep the error is: RewriteBase: only valid in per-directory config files
    When I'm restartig the httpd

    I have the 1.2.3 Version downloaded 2 days ago.

  5. lunabyte
    Member
    Posted 16 years ago #

    "Yep the error is: RewriteBase: only valid in per-directory config files"

    Which means it doesn't go in apache's config file, it goes in the htaccess file that MU generates when it installs.

  6. bosal
    Member
    Posted 16 years ago #

    my apache configuration ignores the .htaccess file, i make the config in rewrite.txt and restart the httpd

  7. lunabyte
    Member
    Posted 16 years ago #

    "ignores the .htaccess file"

    There lies your problem then. No htaccess, no MU.

  8. drmiketemp
    Member
    Posted 16 years ago #

    Pretty much. Not sure why it would be ignoring your .htaccess file. I'd get with your host. Sounds like something's broken. Either that or you're editing your htaccess file with something like Word and formatting's being saved.

  9. bosal
    Member
    Posted 16 years ago #

    It ignores .htaccess instead of this is rewrite.txt file. It's only the configuration. Security configuration. And it make no diffrence if the file was named rewrite.txt or something.txt. It includes rewrite.txt instead of .htaccess.

  10. lunabyte
    Member
    Posted 16 years ago #

    So as a "security" configuration, you allow for a text file, that a browser can read, instead of a hidden file that a browser can't read?

    Does. Not. Compute.

  11. drmiketemp
    Member
    Posted 16 years ago #

    Gotta admit that I've never heard of such a thing and, as Luna says, doesn't really seem to be correct. The dot in the htaccess name hides the file from view.

  12. kelf
    Member
    Posted 16 years ago #

    I got "RewriteBase: only valid in per-directory config files" message when I tried to change some redirect on my hosting.

    Turns out that if I move the redirect section above the part added by wordpress, both my redirect and permalink will work...

    For example, I wanted my domain to add a redirect to my wordpres console, I move the section that wordpress written to the bottom of my .htaccess:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mydomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.mydomain.com$
    RewriteRule ^mywordpress$ http://www.mydomain.com/wp-login.php [R=301,L]

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

    # END WordPress

  13. erick_paper
    Member
    Posted 15 years ago #

    I am looking for the same. The code posted in the last post above does not work.

    To others who don't know why smart webmasters put their rules in httpd.conf itself, and not .htaccess, please read up a little. When Apache starts, it compiles the rules in httpd.conf, which makes them much faster than reading .htaccess for every request. If you're running a blog that your friends read from time to time, it doesn't matter. When you have 10 million hits a day, every little bit matters.

    I hope someone can suggest how to translate the above RewriteRule into httpd.conf directives. I sure hope Wordpress is not based on this silly "requirement" of .htaccess. That's directory based crap, not Apache compiled.

    Thanks for any pointers!

  14. andrea_r
    Moderator
    Posted 15 years ago #

    Since this thread is a year old, can you start a new with with your specific issue?

About this Topic