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?

  • 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

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]
# END WordPress
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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