GetSimple Support Forum

Full Version: Custom redirects doesn´t work as expected - htaccess
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Have you enabled canonical redirects in gsconfig?

I think the Redirect line should be before the Rewriterule.
[QSA,L]

that L means Last Rule

So you might not be getting there ?
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.
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.
You can find some posts with redirection samples for GS in this thread:
http://get-simple.info/forum/topic/1552/...direction/
Hi Carlos,
Thanx! So it works like that:
Code:
RewriteRule ^sidebar-slug.html$ /slug.html [R=303,L]
easy & best, Bell.