Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I've some trouble with typo3 (mydomain.net) and wordpress (mydomain.net/blog/) using mod_rewrite.

First I was running a typo3 installation which uses mod_rewirte without trouble. Now I'm trying to run a wordpress too, but if wordpress uses mod_rewrite, every click of a link bing me back to the index of my typo3.

The filestructure of my ftp-folder:

  • /html/ (contains the typo3 files and folders and the .htaccess-file)
  • /html/blog/ (contains the wordpress files and folders)

This is the content of the .htaccess:

RewriteEngine On

RewriteRule ^(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads|showpic\.php|favicon\.ico)/ - [L]

RewriteRule ^typo3$ typo3/index_re.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]

Any ideas as to what I should do? Or is it possible that only one cms uses mod_rewrite?

share|improve this question
    
Is there another htaccess under /html/blog? You can have many of them. –  paulmorriss Jul 13 '11 at 7:45
    
No, there isn't an other one. May I've to add a new one for wordpress? –  CrazyMetal Jul 13 '11 at 7:50

1 Answer 1

up vote 3 down vote accepted

Generate a WordPress-specific .htaccess file in your /blog/ directory by logging into the WordPress admin area, clicking 'Permalinks' (under the 'Settings' header), scrolling to the bottom of the page, and clicking 'Save Changes'.

This will force WordPress to create its default .htaccess file in your /blog/ directory, which includes all mod_rewrite rules. If you see a message stating that the .htaccess file couldn't be created, copy the code in the error message and create the .htaccess file yourself. By default, the WordPress .htaccess rules should override the rules of your typo3 installation, so both CMSes should co-exist happily.

If you don't see an .htaccess file or an error message, create the default .htaccess file manually containing the following, which specifies the subdirectory you installed WordPress in as /blog/:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
share|improve this answer
    
If this still doesn't work the "Monkeyman Rewrite Analyzer" Wordpress plugin can help you work out what rules are in place. –  paulmorriss Jul 13 '11 at 8:30
    
When I click 'Save Changes' under the 'Permanlinks'-Area, I don't get any .htaccess-file or errormessage. Isn't there an easy way to say somethink like: "If subdirectory 'blog', do this"? ;-) –  CrazyMetal Jul 13 '11 at 8:38
    
@CrazyMetal Try following these instructions to create the .htaccess file manually in your /blog/ directory. –  Nick Jul 13 '11 at 8:45
    
Got it :) Thank you all. I've added a new .htaccess-file in the subdirectory (followed Nicks instruction-link). Important: Don't forget to add the directory name in the file ;) –  CrazyMetal Jul 13 '11 at 8:53
    
@Nick: The last directory name is still missing "RewriteRule . /blog/index.php [L]" ;) –  CrazyMetal Jul 13 '11 at 9:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.