301 redirect possible with htaccess

i tried the solutions with the two plugins and the go-method i found here in the forum. But it doesn’t work or i’am not able to do it right … sorry :confused:

Simple question: Is it possible to do a normal 301 redirect with the htaccess kirby is working with?

I have an old website with urls like thisismyurl.com/index.php?s=team and i want to redirect it to my new kirby website thisismyurl.com/team/

Can anybody please help me?

Thanks a lot!

Yes, you can do that, here is an example:

# reroute old URLs to new URLs
RewriteRule ^index.html$ /new-website/ [R=301,L]
RewriteRule ^([a-z]+)\.html$ /new-website/$1/ [R=301,L]

Hi, thank you for your reply.

Sorry, but i’m not firm with htaccess and so i tried to get your example work in my site. But it does not :frowning:

I write this line

RewriteRule ^index.php?s=teams /teams/ [R=301,L]

right after the line with RewriteEngine on.

Anything I do wrong :wink: I need both lines you give me?

In my example, I needed both, because I had to redirect the index.html and the rest to their corresponding subpages. The .htaccess on the remote server looks like this:

RewriteBase /

# reroute old URLs to new URLs
RewriteRule ^index.html$ / [R=301,L]
RewriteRule ^([a-z]+)\.html$ /$1/ [R=301,L]

The rewrite rules are directly after the rewrite base, which I had to set on this server.

I’m not really to firm in .htaccess rules and had to do some trial and error testing until it worked.