Reputation: 43
I have trouble with adding some commands in my old .htaccess at root folder: Before:
AddDefaultCharset utf-8
DirectoryIndex category.php index.php
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteRule ^search/$ category.php?category=search&%{QUERY_STRING} [L]
RewriteRule ^module_([A-Za-z0-9]+)/?([^/\.]*)/?([^/\.]*)/?([^/\.]*)/?$ module.php?class=$1&pv1=$2&pv2=$3&pv3=$4 [L]
RewriteRule ^((print)_)?([^/\.]+)/?([^/\.]*)/?([^/\.]*)/?([^/\.]*)/?$ category.php?category=$3&id_module=$4&pv1=$5&pv2=$6&showtype=$2
php_value magic_quotes_gpc 0
php_value upload_max_filesize 52428800
php_value error_reporting 6135
php_value session.cookie_lifetime 86400
After adding this strings:
Redirect 301 /sect_25/ /stati/126/12/#read
Redirect 301 /sect_24/ /stati/126/9/#read
Redirect 301 /sect_23/ /stati/126/10/#read
Redirect 301 /articles/sect_19/ /stati/126/13/#read
Page is not available anymore: The server encountered an internal error or misconfiguration and was unable to complete your request. Help somebody, please!
Upvotes: 0
Views: 737
Reputation: 33904
I guess the second URL should be a full URL:
Redirect 301 /sect_25/ http://your.domain.tld/stati/126/12/#read
Upvotes: 0
Reputation: 655489
You should not mix mod_rewrite and mod_alias (Redirect
); use only one of them to avoid conflicts. You could, for example, turn your Redirect
directives into RewriteRule
directives:
RewriteRule ^sect_25/ /stati/126/12/#read [L,R=301]
RewriteRule ^sect_24/ /stati/126/9/#read [L,R=301]
RewriteRule ^sect_23/ /stati/126/10/#read [L,R=301]
RewriteRule ^articles/sect_19/ /stati/126/13/#read [L,R=301]
Now just make sure to put these externally redirecting rules in front of you other internally rewriting rules.
Upvotes: 1