mod_rewrite htaccess problem

New to mod_rewrite? This is a good place to start.

mod_rewrite htaccess problem

Postby user36 » Thu May 14, 2009 7:17 am

Hello there,

this is my first post here, my english isnt that good so please be merciful :D

ive got a really urgent problem with mod rewrite. My Permalinkstructure looks like this %postname%.htm. My Categorybase is just a ".", so that there is no category name in the permalink-url.
My Problem is that some old urls listed in google link to a directory called "aktuelles".
The htaccessfile- generated by wordpress:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

It works fine but now i need a tweak which redirects urls from aktuelles/ to the root directory, also the extension has to be changed from html to html:
#RewriteRule ^(.*)aktuelles([^0-9]*)$ $1$2 [R=301,L]
#RewriteRule (.*)\.html$ /$1.htm

The problem is now how to combinate these two things. Im thankful for any advice.Its really urgent, please help me. Im also thankful for resources or a wordpress pro who can fix it quickly.

Thanks in advance

Greetings , Daniel
user36
 
Posts: 1
Joined: Thu May 14, 2009 7:15 am

Postby richardk » Fri May 15, 2009 8:37 am

Try
Code: Select all
Options +FollowSymLinks

<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteRule ^aktuelles(/(.*))?$ /$2     [R=301,L]
  RewriteRule ^(.+)\.html$        /$1.htm [R=301,L]

  # BEGIN WordPress
  RewriteCond %{SCRIPT_FILENAME} !-f
  RewriteCond %{SCRIPT_FILENAME} !-d
  RewriteRule . /index.php [L]
  # END WordPress
</IfModule>
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 16 guests

cron