htaccess redirect (301) all my old content from my wordpress to my new url-design. I want to redirect all the last trailingslashs to .html ... the permalinks are allready working, but i dont want to loose all my hardly collected backlinks. Thats how my Urls look like:
Pages (old): domain.com/pages/redirection/ should redirect to domain.com/pages/redirection.html Posts (old): domain.com/new-permalink/ shuold redirect to domain.com/news/new-permalink.html Custom Posts domain.com/permalink/ should redirect to domain.com/projects/permalink.html
Any help would be grateful :)
thx
---Comments only allow few words so i edit my question:
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymLinks
RewriteBase /project/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /project/index.php [L]
RewriteRule /project/([^/]*)/?$ /project/$1.html [L]
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html </IfModule> # END WordPress
Did not work for me.. it ignores my rewritebase, so it redirects domain.com/projects/permalink/ to domain.com/permalink.html not to domain.com/projects/permalink.html
/projects/folder already, then remove/project/from rewrite pattern for last rule; should beRewriteRule ([^/]*)/?$ /project/$1.html [L]. P.S. and please stop using xxxxx for everything -- be creative and use a bit more realistic/easy to distinguish URLs... – LazyOne Jul 26 '11 at 20:42example.com/project/.. then you may have such response. If so -- addRewriteRule ^$ /project/index.php [L]line after RewriteBase line, for example (but definitely before the previously mentioned rule). – LazyOne Jul 26 '11 at 21:38<IfModule mod_rewrite.c> RewriteEngine On Options +FollowSymLinks RewriteBase /project/ RewriteRule ^$ /project/index.php [L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /project/index.php [L] RewriteRule ([^/]*)/?$ /project/$1.html [L] </IfModule> # END WordPress– Gecko453 Jul 26 '11 at 21:52RewriteLogLevel 9and check rewrite log for details. You are the person who knows for sure how site works/should work, and should see from logs what is going wrong and where. All my advices, while technically be correct, still may be inappropriate for particular situation/location. – LazyOne Jul 26 '11 at 23:40