Title: .htaccess issues, help please? :)
Last modified: August 18, 2016

---

# .htaccess issues, help please? :)

 *  [itrends](https://wordpress.org/support/users/itrends/)
 * (@itrends)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/htaccess-issues-help-please/)
 * Hey all, I am just installing wordpress on a site of mine.
    I also run drupal
   on the site. I am having issues getting re-write rules to work for both applications.
 * If I put the wordpress rewrites at the top then wordpress works, if I put the
   drupal ones at the top then drupal works.
 * Is there anyway to edit the below code so that there is essentially an “else”
   clause going on so that if it is a wordpress page it will use one set and if 
   it is a drupal page it will use another?
 * # Various rewrite rules.
    <IfModule mod_rewrite.c> RewriteEngine on
 *  # Modify the RewriteBase if you are using Drupal in a subdirectory and
    # the
   rewrite rules are not working properly. RewriteBase /
 *  # Rewrite old-style URLs of the form ‘node.php?id=x’.
    #RewriteCond %{REQUEST_FILENAME}!-
   f #RewriteCond %{REQUEST_FILENAME} !-d #RewriteCond %{QUERY_STRING} ^id=([^&]
   +)$ #RewriteRule node.php index2.php?q=node/view/%1 [L]
 *  # Rewrite old-style URLs of the form ‘module.php?mod=x’.
    #RewriteCond %{REQUEST_FILENAME}!-
   f #RewriteCond %{REQUEST_FILENAME} !-d #RewriteCond %{QUERY_STRING} ^mod=([^&]
   +)$ #RewriteRule module.php index2.php?q=%1 [L]
 *  # Rewrite current-style URLs of the form ‘index2.php?q=x’.
    RewriteCond %{REQUEST_FILENAME}!-
   f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index2.php?q=$1 [L,QSA]
   </IfModule>
 * # $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $
    # BEGIN WordPress <IfModule
   mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}!-
   f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule
   >
 * # END WordPress
 * Many thanks,
    David

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Jeremy Clark](https://wordpress.org/support/users/jeremyclark13/)
 * (@jeremyclark13)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/htaccess-issues-help-please/#post-641814)
 * Why do you have both in the same directory.
 *  Thread Starter [itrends](https://wordpress.org/support/users/itrends/)
 * (@itrends)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/htaccess-issues-help-please/#post-641818)
 * For a number of reasons. 🙂
    And i don’t want wordpress in a sub folder either
   because of a transition which is due to take place down the road 🙂
 * Anywho,…. is there any way I can do what I want in the same directory? 🙂
 * Thanks,
    Dave
 *  Thread Starter [itrends](https://wordpress.org/support/users/itrends/)
 * (@itrends)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/htaccess-issues-help-please/#post-641820)
 * Still stuck….
 *  Thread Starter [itrends](https://wordpress.org/support/users/itrends/)
 * (@itrends)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/htaccess-issues-help-please/#post-641827)
 * Ok sorted it,
    I just created a rule for the drupal date format urls:
 * # Start Drupal
    <IfModule mod_rewrite.c> RewriteEngine on
 *  # Modify the RewriteBase if you are using Drupal in a subdirectory and
    # the
   rewrite rules are not working properly. RewriteBase /
 *  # Rewrite current-style URLs of the form ‘index2.php?q=x’.
    RewriteCond %{REQUEST_FILENAME}!-
   f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(2004/.*/.*/.*)$ index2.php?
   q=$1 [NC,L,QSA] RewriteRule ^(2005/.*/.*/.*)$ index2.php?q=$1 [NC,L,QSA] RewriteRule
   ^(2006/.*/.*/.*)$ index2.php?q=$1 [NC,L,QSA] RewriteRule ^(2007/.*/.*/.*)$ index2.
   php?q=$1 [NC,L,QSA] RewriteRule ^(2008/.*/.*/.*)$ index2.php?q=$1 [NC,L,QSA] 
   </IfModule> # END Drupal
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond%{
   REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /
   index.php </IfModule> # END WordPress

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘.htaccess issues, help please? :)’ is closed to new replies.

## Tags

 * [drupal](https://wordpress.org/support/topic-tag/drupal/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [itrends](https://wordpress.org/support/users/itrends/)
 * Last activity: [18 years, 7 months ago](https://wordpress.org/support/topic/htaccess-issues-help-please/#post-641827)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
