2015-10-02, 17:19:27
(This post was last modified: 2015-10-03, 01:31:04 by Hypertexter.)
Hello,
I would like to make a 301 redirection via .htaccess file for one single page.
My rewrite rules at the moment are:
But the line with ...oldpagename ...newpagename does not work. What am I doing wrong?
The other redirections are for urls without .html and for urls always with www and other stuff.
Bye
Hypertexter
Wow, seems to work with:
But it was trial and error - with a phase of a frozen Firefox or server, where no redirection worked any more, very funny.
Does anybody know a good introduction into the syntax of .htaccess for beginners? I just found a lot of "do this" without further explanations.
I would like to make a 301 redirection via .htaccess file for one single page.
My rewrite rules at the moment are:
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
# Usually RewriteBase is just '/', but
# replace it with your subdirectory path
# RewriteBase /getsimple/
RewriteBase /
# Rewrite www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# without .html
RewriteRule ^(.*)\.html$ $1 [R=301,L]
RewriteRule ^folder/oldpagename http://www.domainname.de/folder/newpagename [R=301,L] # how??
RewriteRule ^oldfolder http://www.domainname.de/newfolder [R=301,L]
RewriteRule ^blog/tag/?$ /blog [R=301,L]
RewriteRule ^blog/post/?$ blog [R=301,L]
# News Manager:
RewriteRule ^blog/tag/([^/.]+)/page/([^/.]+)/?$ index.php?id=blog&tag=$1&page=$2 [L]
RewriteRule ^blog/tag/([^/.]+)/?$ index.php?id=blog&tag=$1 [L]
RewriteRule ^blog/post/([^/.]+)/?$ index.php?id=blog&post=$1 [L]
RewriteRule ^blog/page/([^/.]+)/?$ index.php?id=blog&page=$1 [L]
RewriteRule ^blog/archive/([^/.]+)/?$ index.php?id=blog&archive=$1 [L]
# end News Manager
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
RewriteRule ^data/uploads/(.*)$ plugins/download_interceptor/intercept.php?file=$1 [L]
</IfModule>
But the line with ...oldpagename ...newpagename does not work. What am I doing wrong?
The other redirections are for urls without .html and for urls always with www and other stuff.
Bye
Hypertexter
Wow, seems to work with:
Code:
RewriteRule ^blog/post/oldpagename/?$ $1/blog/post/newpagename [R=301,L]
But it was trial and error - with a phase of a frozen Firefox or server, where no redirection worked any more, very funny.
Does anybody know a good introduction into the syntax of .htaccess for beginners? I just found a lot of "do this" without further explanations.