Morpheo Posted November 9, 2015 Share Posted November 9, 2015 I am trying to turn on the Rewrite URLs feature in System >> Search Engine Optimization >> Friendy URLs. My site already has two .htaccess files: 1) In the site's root directory. This is the main .htaccess file which I am modifying. 2) In the [root]/wordpress/ directory which is necessary for the wordpress blog I have located on my site. I am not modifying this. The problem is, when I paste the required code into the root .htaccess file, everything works but my wordpress URLs become broken. How do make sure that the wordpress .htaccess file is unaffected? Here is the htaccess code I'm pasting in: IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase /forum/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) /forum/404error.php [L,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /forum/index.php [L] </IfModule> And here is the .htaccess file in the [root]/wordpress/ directory: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] </IfModule> # END WordPress Thanks! Link to comment Share on other sites More sharing options...
Adlago Posted November 9, 2015 Share Posted November 9, 2015 What your domain loaded- IPS forum or WordPress? Link to comment Share on other sites More sharing options...
ipbfuck Posted November 9, 2015 Share Posted November 9, 2015 IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase /forum/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) /forum/404error.php [L,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /forum/index.php [L] </IfModule> this os valid for forum subdirectory, not in root! if u have your ipb I, root u can edit as: <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) /404error.php [L,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> and WordPress htaccess is no more necessary (is the same code, so, it's redundancy)! Link to comment Share on other sites More sharing options...
Morpheo Posted November 9, 2015 Author Share Posted November 9, 2015 Thank you very much! That fixed it! I simply created a new .htaccess file in the /forum/ directory and placed the code there. Now it works! :D Link to comment Share on other sites More sharing options...
ipbfuck Posted November 9, 2015 Share Posted November 9, 2015 ok, one subdirectory for forum, and another for WordPress! so, is best to put two separate htaccess (one in every directory with right rewritebase) without htaccess in root (or only one in root and test if work fine for both subdirectory... I think to yes, but untested) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.