permanent redirect problem
Posted: Thu Sep 15, 2011 1:49 pm
Hi,
after a long time of running my blog without url-rewriting I recently decided to use it, in order to get
rid of the irritating domain.com/?/archives/id-article.html url structure.
I managed to change urls as desired. .htaccess is doing it's job, after I had to change the initial lines slightly.
now:
old article url: http://www.multikulinarisch.es/?/archiv ... lerie.html
new article url: http://www.multikulinarisch.es/677-apfelgalerie.html
Then I tried to implement a permanent redirect (301) in order to leave old (often linked to) urls accesible as well as not loose pretty good google-indication on several articles.
I tried all sorts of rewrite rules. (in blog directory's .htaccess as well as in root directory)
A redirect never occured (url in browser didn't change). When checking my old urls in web-sniffer.net it never shows status code 301 but always 200. Therefore the redirect doesn't seem to work at all.
I read through pretty much all redirect posts in this forum and still couldn't figure out, why redirect
is not working in my case.
I'm aware, that php header('Location:...') may be used, but really would like to keep
rewriting/redirecting stuff to .htaccess
Even though canonical url may be used, too, I'd still prefer a proper redirect. Therefore I tried (among other stuff):
1)
2)
3)
4)
5)
6)
7)
8 )
9)
10) commenting out this section, since it creates the /?/... url syntax
Nothing did the trick.
Could anyone please help me, to achieve a permanent redirect for articles? Thanks,
Peggy
after a long time of running my blog without url-rewriting I recently decided to use it, in order to get
rid of the irritating domain.com/?/archives/id-article.html url structure.
I managed to change urls as desired. .htaccess is doing it's job, after I had to change the initial lines slightly.
now:
Code: Select all
Options +Indexes
Options +FollowSymlinks
RewriteEngine on
AddCharset utf-8 .css .html .xhtmlnew article url: http://www.multikulinarisch.es/677-apfelgalerie.html
Then I tried to implement a permanent redirect (301) in order to leave old (often linked to) urls accesible as well as not loose pretty good google-indication on several articles.
I tried all sorts of rewrite rules. (in blog directory's .htaccess as well as in root directory)
A redirect never occured (url in browser didn't change). When checking my old urls in web-sniffer.net it never shows status code 301 but always 200. Therefore the redirect doesn't seem to work at all.
I read through pretty much all redirect posts in this forum and still couldn't figure out, why redirect
is not working in my case.
I'm aware, that php header('Location:...') may be used, but really would like to keep
rewriting/redirecting stuff to .htaccess
Even though canonical url may be used, too, I'd still prefer a proper redirect. Therefore I tried (among other stuff):
1)
Code: Select all
RedirectPermanent \?/archives/ http://www.multikulinarisch.es/Code: Select all
RewriteRule ^\?/archives/(.*)$ /$1 [R=301]Code: Select all
RewriteRule ^/\?/archives/(.*)$ /$1 [R=301]Code: Select all
RewriteRule \?/archives/(.*) /$1 [R=301]Code: Select all
RewriteRule ^\?/archives/ http://www.multikulinarisch.es/ [R=301]Code: Select all
RewriteCond %{REQUEST_URI} ^\?
RewriteRule (.*)/archives/(.*)$ /$2 [R=301]Code: Select all
RewriteCond %{REQUEST_URI} /\?/
RewriteRule /archives/(.*) /$1 [R=301]Code: Select all
RewriteCond %{REQUEST_URI} ^\?/
RewriteRule /archives/(.*) /$1 [R=301]Code: Select all
RewriteCond %{REQUEST_URI} /\?{1}
RewriteRule ^(.*)/archives/(.*)$ /$2 [R=301]
Code: Select all
RewriteRule ^((([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.html)/?) ?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+) ?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) ?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) ?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+) ?/$1 [NC,L,QSA]
Could anyone please help me, to achieve a permanent redirect for articles? Thanks,
Peggy