301 Redirect to single page?
Permalink 1 user found helpful
Hello everyone.
I have redesigned a website using Concrete5. Some of the functionality has been implemented using single pages, which are great.
Now, I'd like to create a 301 redirect from the old page to the new single page. I've read that I can use the Dashboard sitemap for this, by adding the old URL to "paths and locations", but the second textbox for 'other urls' doesn't show there.
I take it this is because it is a single page.
Then how do I add a 301 redirect?
If I try to add a redirect to .htaccess, my entire site fails with an "Internal Server Error". As soon as I remove the line I added, the site works fine again.
This is my (faulty) .htaccess :
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^news.php$ /news [QSA, NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --
Can anyone spot what I'm doing wrong? Is there a better way to enter 301 redirects?
Thanks a lot for all the help.
I have redesigned a website using Concrete5. Some of the functionality has been implemented using single pages, which are great.
Now, I'd like to create a 301 redirect from the old page to the new single page. I've read that I can use the Dashboard sitemap for this, by adding the old URL to "paths and locations", but the second textbox for 'other urls' doesn't show there.
I take it this is because it is a single page.
Then how do I add a 301 redirect?
If I try to add a redirect to .htaccess, my entire site fails with an "Internal Server Error". As soon as I remove the line I added, the site works fine again.
This is my (faulty) .htaccess :
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^news.php$ /news [QSA, NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --
Can anyone spot what I'm doing wrong? Is there a better way to enter 301 redirects?
Thanks a lot for all the help.
Thanks a lot. This seems to solve my problem!
Glad to help!
Hi Snigg
This looks well, but what if I have, say a site with 50 + pages, do I then need to do this for all of them in my .htaccess or is there a more generel way to perform a 301 redirect ?
Otherwise I will have to do the entire pagetree in this way as suggested :0)
//Carsten
This looks well, but what if I have, say a site with 50 + pages, do I then need to do this for all of them in my .htaccess or is there a more generel way to perform a 301 redirect ?
Otherwise I will have to do the entire pagetree in this way as suggested :0)
//Carsten
This add-on may do what you need.
SEO: 301 Redirects
developed by smartwebprojects
http://www.concrete5.org/marketplace/addons/seo-301-redirects/...
SEO: 301 Redirects
developed by smartwebprojects
http://www.concrete5.org/marketplace/addons/seo-301-redirects/...
Hi guys,
Thanks for the post, a excellent starting point for solving my problem: I have a site that has bilingual versions (en and ro) and by default I'd like the user to be redirected to the Romanian homepage, i.e.http://www.recolamp.ro -->http://www.recolamp.ro/ro/
I did it until now using "Page Redirect" (http://www.concrete5.org/marketplace/addons/page-redirect/) which is a free add-on and it works very well. The only problem is that it issues a non configurable 302 redirect status code and not the 301 Google/Seo preferred way.
So here it is my small return to the community:
To redirect the root of a website using 301 status code you can use this line in .htaccess:
This line should be placed before "RewriteEngine On", see where "sniggitysnax" user places his "Redirect" directives.
Also to check that the returned redirect status:http://www.internetofficer.com/seo-tool/redirect-check/...
Cheers!
Thanks for the post, a excellent starting point for solving my problem: I have a site that has bilingual versions (en and ro) and by default I'd like the user to be redirected to the Romanian homepage, i.e.http://www.recolamp.ro -->http://www.recolamp.ro/ro/
I did it until now using "Page Redirect" (http://www.concrete5.org/marketplace/addons/page-redirect/) which is a free add-on and it works very well. The only problem is that it issues a non configurable 302 redirect status code and not the 301 Google/Seo preferred way.
So here it is my small return to the community:
To redirect the root of a website using 301 status code you can use this line in .htaccess:
RedirectMatch 301 ^/$ http://www.recolamp.ro/ro/
This line should be placed before "RewriteEngine On", see where "sniggitysnax" user places his "Redirect" directives.
Also to check that the returned redirect status:http://www.internetofficer.com/seo-tool/redirect-check/...
Cheers!
Thank you so much, this help a lot with the multilingual 302 that i was geting... in the sitehttp://cheftech.ca ^_^
At the end of my .htaccess file i have this... is it duplicate ? Thank you for any help.
At the end of my .htaccess file i have this... is it duplicate ? Thank you for any help.
# -- concrete5 urls start -- <IfModule mod_rewrite.c> RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.html !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f RewriteRule . index.php [L] </IfModule> # -- concrete5 urls end -- # -- concrete5 urls start -- <IfModule mod_rewrite.c> RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.html !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f
Viewing 15 lines of 18 lines. View entire code block.
This is the .access i have... is there something wrong here ? what do you think ? Is there to much redirects ? or duplicate content?. Thanks.
RedirectMatch 301 ^/$ http://cheftech.ca/fr/ RewriteEngine on RewriteCond %{HTTP_HOST} ^cheftech\.ca$ [OR] RewriteCond %{HTTP_HOST} ^www\.cheftech\.ca$ RewriteRule ^contact$ "http\:\/\/cheftech\.ca\/fr\/contact\/" [R=301,L] RewriteCond %{HTTP_HOST} ^c5\.plasmamultimedia\.ca$ [OR] RewriteCond %{HTTP_HOST} ^www\.c5\.plasmamultimedia\.ca$ RewriteRule ^fr\/portfolio\/$ "http\:\/\/cheftech\.ca\/fr\/portfolio\/" [R=301,L] RewriteCond %{HTTP_HOST} ^c5\.plasmamultimedia\.ca$ [OR] RewriteCond %{HTTP_HOST} ^www\.c5\.plasmamultimedia\.ca$ RewriteRule ^/?$ "http\:\/\/cheftech\.ca\/" [R=301,L] RewriteCond %{HTTP_HOST} ^www\.cheftech\.ca$ RewriteRule ^/?$ "http\:\/\/cheftech\.ca\/" [R=301,L] RewriteCond %{HTTP_HOST} ^cheftech\-ca\.plasmamultimedia\.ca$ [OR] RewriteCond %{HTTP_HOST} ^www\.cheftech\-ca\.plasmamultimedia\.ca$
Viewing 15 lines of 36 lines. View entire code block.
So in the above example, the page to be redirected goes directly after the 301 and the page to be redirected to goes directly after that with a preceding space.