Announcement

Collapse
No announcement yet.

.htaccess conflict with Wordpress in main folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • .htaccess conflict with Wordpress in main folder

    Just bought and installed VBulletin Connect 5 Beta 16 and have been having some issues related to .htaccess and Wordpress.

    Hopefully someone might be able to help me.

    I have wordpress installed on my main domain and a forum installed in a subfolder.

    However the Wordpress .htaccess rules conflict with my .htaccess rules for vbulletin, as I am unable to access admincp unless I remove Wordpress' htaccess.

    Any suggestions would be much appreciated.

    HT access files are below:

    Wordpress:

    Code:
    # BEGIN WordPress<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    
    
    
    #----- START DAP -----
    RewriteCond %{REQUEST_FILENAME} -f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} (.*)/wp-content/uploads/(.*) 
    RewriteCond %{REQUEST_FILENAME} !(.*)(\.php|\.css|\.js|\.jpg|\.gif|\.png|\.txt|\.ico|\.jpeg)$ 
    RewriteRule (.*) /dap/client/website/dapclient.php?dapref=%{REQUEST_URI}&plug=wp&%{QUERY_STRING}  [L] 
    #----- END DAP -----
    
    
    </IfModule>
    
    
    # END WordPress
    VBulletin:

    Code:
    <IfModule mod_rewrite.c>RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
    
    
    #needed because admincp is an actual directory.
    RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
    </IfModule>

  • #2
    Try changing your wordpress htaccess:

    Code:
    # BEGIN WordPress<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # if request is not for the /sub-dir/
    RewriteCond %{REQUEST_URI} !^/sub-dir/ [NC]
    RewriteRule . /index.php [L]
    
    
    
    
    #----- START DAP -----
    RewriteCond %{REQUEST_FILENAME} -f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} (.*)/wp-content/uploads/(.*) 
    RewriteCond %{REQUEST_FILENAME} !(.*)(\.php|\.css|\.js|\.jpg|\.gif|\.png|\.txt|\.ico|\.jpeg)$ 
    # if request is not for the /sub-dir/
    RewriteCond %{REQUEST_URI} !^/sub-dir/ [NC]
    RewriteRule (.*) /dap/client/website/dapclient.php?dapref=%{REQUEST_URI}&plug=wp&%{QUERY_STRING}  [L] 
    #----- END DAP -----
    
    
    </IfModule>
    Taken from here: http://stackoverflow.com/questions/9...htaccess-rules

    Try chaging sub-dir to the vbulletin folder name.

    Comment


    • #3
      Thanks.

      Unfortunately that didn't seem to make any difference.

      It's all rather frustrating....

      I can't really lose my .htaccess for wordpress, although at the moment it seems the only way I can get this to work.

      Comment


      • #4
        I'd suggest going to them about asking how to turn rewrites off for a specific subfolder.

        Comment


        • #5
          Thanks. For others who have a similar problem and having spent probably 12 hours in total trying to get this to work, the problem ended up being pretty simple!

          Adding in rewritebase /forum (change forum to your subdirectory) into the vbulletin htaccess seems to solve it, as per line 2 in the below vbulletin .htaccess..

          If any htaccess gurus happen to see this and think that is a very bad idea, please let me know. Otherwise i am happy as I can now actually start to use my forum!

          Code:
          RewriteEngine On
          RewriteBase /forum
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
          
          
          #needed because admincp is an actual directory.
          RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
          Last edited by Justin Wheeler; Wed 31st Oct '12, 6:48am.

          Comment


          • #6
            To have your parent directory ignore the forum directory you would add this to the .htaccess:

            RewriteRule ^forum/ - [L]

            Using RewriteBase can also resolve the issue because it resets the rewrite rules as far I am aware.

            Unfortunately adding this by default isn't possible either.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API - Full / Mobile
            Vote for your favorite feature requests and the bugs you want to see fixed.

            Comment


            • #7
              Thanks Wayne, The RewriteRule was also one I tried on my way to get it working.

              The only one that did the job was the RewriteBase, so as long as it won't have any adverse effects I hope I will be okay!

              Comment


              • #8
                Worked beautifully for me! This was the first time I'd run into that particular combo -- WordPress in the root and vBulletin 5 in a directory -- and that one-line change was all I needed. I've had WordPress at the root of other forum sites but never vBulletin 5. Thanks for the very timely post!

                Comment


                • #9
                  Same problem. New to vBulletin. Fresh successful install of vB5 Beta 17. Forum loads fine, can't login to admincp (I see login screen, enter login data, blank page).

                  I read above and some other threads, have tried some things, but nothing is working.

                  Wordpress installed on ROOT / vB5 installed in subdir named FORUM.

                  I have .htaccess on root (which I modified like 'Justin Wheeler' did above) and I also have .htaccess in the 'forum' dir.

                  Server info:
                  Apache version 2.2.22
                  PHP version 5.2.17
                  MySQL version 5.5.23-55
                  Operating system linux
                  Perl version 5.8.8

                  Root htaccess:

                  Code:
                  # BEGIN WordPress
                  <IfModule mod_rewrite.c>
                  RewriteEngine On
                  RewriteBase /
                  RewriteRule ^index\.php$ - [L]
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteRule . /index.php [L]
                  </IfModule>
                  
                  # END WordPress
                  
                  
                   <IfModule mod_rewrite.c>
                  RewriteEngine On
                  RewriteBase /forum
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
                  
                  #needed because admincp is an actual directory.
                  RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
                  </IfModule>
                  
                  # Use PHP 5.3
                  AddType application/x-httpd-php53 .php
                  'forum' subdir htaccess:

                  Code:
                  <IfModule mod_rewrite.c>
                  RewriteEngine On
                  RewriteBase /forum
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
                  
                  #needed because admincp is an actual directory.
                  RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
                  </IfModule>
                  
                  # Use PHP 5.3
                  AddType application/x-httpd-php53 .php

                  Comment


                  • #10
                    Change: RewriteBase /forum

                    To:
                    RewriteBase /forum/
                    Translations provided by Google.

                    Wayne Luke
                    The Rabid Badger - a vBulletin Cloud demonstration site.
                    vBulletin 5 API - Full / Mobile
                    Vote for your favorite feature requests and the bugs you want to see fixed.

                    Comment


                    • #11
                      My guess is that you need to remove this part from the wordpress .htaccess and just have it in the forum .htaccess.

                      Not sure what the Use PHP 5.3 bit is and where that is needed, I didn't have it in mine so that may or may not need to remain in the wordpress .htaccess.

                      <IfModule mod_rewrite.c>
                      RewriteEngine On
                      RewriteBase /forum
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]

                      #needed because admincp is an actual directory.
                      RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
                      </IfModule>

                      Comment


                      • #12
                        Thanks guys, but I tried both suggestions and neither worked. I see this is a popular topic - is anything being done to prevent/correct it in an update? (again, new to vBulletin all together so I'm not sure how updates and things work).

                        Comment


                        • #13
                          What are your two .htaccess files now?

                          And stupid question but the forum is actually in a subfolder called forum isn't it?

                          Comment


                          • #14
                            WP on root:

                            Code:
                            # BEGIN WordPress
                            <IfModule mod_rewrite.c>
                            RewriteEngine On
                            RewriteBase /
                            RewriteRule ^index\.php$ - [L]
                            RewriteCond %{REQUEST_FILENAME} !-f
                            RewriteCond %{REQUEST_FILENAME} !-d
                            RewriteRule . /index.php [L]
                            </IfModule>
                            
                            # END WordPress
                            
                            
                            
                            # Use PHP 5.3
                            AddType application/x-httpd-php53 .php
                            Forum (yes, it's in a subdir named 'forum'

                            Code:
                            <IfModule mod_rewrite.c>
                            RewriteEngine On
                            RewriteBase /forum/
                            RewriteCond %{REQUEST_FILENAME} !-f
                            RewriteCond %{REQUEST_FILENAME} !-d
                            RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
                            
                            #needed because admincp is an actual directory.
                            RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
                            </IfModule>

                            Comment


                            • #15
                              bump

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X