The MU forums have moved to WordPress.org

Dreamhost mod-rewrite question (3 posts)

  1. corourke
    Member
    Posted 17 years ago #

    In order to access Dreamhost's stats you need to go to this url (hosted with dreamhost):

    http://domain.tld/stats

    I'd like to check the dreamhost stats but to access them with wordpress you need to add this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/failed_auth.html$
    RewriteRule ^.*$ - [L]

    How would I add that into the htaccess to work? I tried adding it in and it didn't work at all (just loaded the main site).

  2. leecoursey
    Member
    Posted 15 years ago #

    You simply add that to the top line of your .htaccess file.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/failed_auth.html$
    RewriteRule ^.*$ - [L]
    
    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ /$1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
  3. SteveAtty
    Member
    Posted 15 years ago #

    I think you've missed the /IfModule for the rewrite. Also you can get rid of the second Engine On and Base lines

    If you know mod_rewrite is installed and available then you can take the IfModule checks out as well

About this Topic

  • Started 17 years ago by corourke
  • Latest reply from SteveAtty