Jump to content

Htaccess File For Friendy URLs Conflict


Morpheo

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...