Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 9, 20159 yr 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!
November 9, 20159 yr 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)!
November 9, 20159 yr Author 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
November 9, 20159 yr 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)
Archived
This topic is now archived and is closed to further replies.