ZenphotoCMS Forum
301-redirect in htaccess - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: 301-redirect in htaccess (/thread-10674.html)



301-redirect in htaccess - yanzen - 26-12-2012

I know it is not strictly a zenphoto-issue, but I htought maybe someone here has had solved it already.

I am trying to achieve a 301-redirect of a page to a news category through htacess. The page is called "foo", the news-category is called "bar", so /pages/foo should redirect to /news/category/bar

So far I use

Redirect 301 /pages/foo http://www.mysite.de/news/category/bar

The problem is, that it somehow adds the non-beautified url-paramaeters to the end, so when I click on the menu item "foo" I get redirected to

mysite.de/news/category/bar?p=pages&title=foo

Does anyone know how I can prevent the rule from adding "?p=..."?

Thanks a lot and Happy Christmas




301-redirect in htaccess - acrylian - 26-12-2012

Where did you add that redirection? /pages/ is actually a rewritten url, the actual one is p=pages&title=.

Try this : RewriteRule ^pages/foo news/category/foo [L,R=301]
(Of course with the proper names instead foo). This is what we still have to redirect some older links when our site used Wordpress.




301-redirect in htaccess - yanzen - 26-12-2012

Thanks a bunch acrylian! I tried various locations, what works now is

RewriteRule ^pages/foo news/category/bar [L,R=301]

right after the opening

RewriteEngine On
RewriteBase /

I also tried with non-rewritten urls but that did not work.

I love Zenphoto!