GetSimple Support Forum
Custom redirects doesn´t work as expected - htaccess - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Custom redirects doesn´t work as expected - htaccess (/showthread.php?tid=3707)



Custom redirects doesn´t work as expected - htaccess - Belletage - 2012-10-22

Hi,
I´ve some pages (sidebar-text), which are part of others
and I want to redirect their slug-names to the fitting page.

I add the htaccess with
Code:
RewriteRule /?([A-Za-z0-9_-]+)\.html$ index.php?id=$1 [QSA,L]

Redirect /sidebar-slug.html http://www.domain.tld/slug.html

but when I call the side, it happens something like that:
domain.tld/slug.html?id=sidebar-slug

and I see my sidebar-text. :-|

whats the problem there? The RewriteRule - but I need it.
(it works on an other CMS - but I´m not used to server/htaccess-stuff ...)

thanks for help,
best, Bell.


Custom redirects doesn´t work as expected - htaccess - Carlos - 2012-10-22

Have you enabled canonical redirects in gsconfig?

I think the Redirect line should be before the Rewriterule.


Custom redirects doesn´t work as expected - htaccess - shawn_a - 2012-10-22

[QSA,L]

that L means Last Rule

So you might not be getting there ?


Custom redirects doesn´t work as expected - htaccess - Belletage - 2012-10-23

Hi, thank you,
> Have you enabled canonical redirects in gsconfig?
I tried, but that brings an "redirection loop"-error, if I call domain.tld/sidebar-slug.html

I set Redirect ahead of the RewriteRule
but still the same ...

now I´ve
Code:
...RewriteEngine on
RewriteBase /
Redirect /sidebar-slug.html http://www.domain.tld/slug.html
RewriteRule /?([A-Za-z0-9_-]+)\.html$ index.php?id=$1 [QSA,L]
#end

anyhow I have to keep away the ?id=sidebar-slug
in the redirect-case
Bell.


Custom redirects doesn´t work as expected - htaccess - Carlos - 2012-10-23

I asked about canonical redirects just in case that was the problem. Better keep it disabled.

I don't know much about .htaccess, I hope some other user can help you, sorry.


Custom redirects doesn´t work as expected - htaccess - Carlos - 2012-10-23

You can find some posts with redirection samples for GS in this thread:
http://get-simple.info/forum/topic/1552/how-can-i-make-redirection/


Custom redirects doesn´t work as expected - htaccess - Belletage - 2012-10-23

Hi Carlos,
Thanx! So it works like that:
Code:
RewriteRule ^sidebar-slug.html$ /slug.html [R=303,L]
easy & best, Bell.