Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom redirects doesn´t work as expected - htaccess
#1
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.
Reply
#2
Have you enabled canonical redirects in gsconfig?

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

that L means Last Rule

So you might not be getting there ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
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.
Reply
#5
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.
Reply
#6
You can find some posts with redirection samples for GS in this thread:
http://get-simple.info/forum/topic/1552/...direction/
Reply
#7
Hi Carlos,
Thanx! So it works like that:
Code:
RewriteRule ^sidebar-slug.html$ /slug.html [R=303,L]
easy & best, Bell.
Reply




Users browsing this thread: 1 Guest(s)