0

I'm trying to redirect a url but I can't seem to make it work for some reason. I'm trying to redirect my.domain.com/rss/abc/ to my.domain.com/rss/abc/?type=555

I've put this in my .htaccess

RewriteEngine On
# Redirects rss
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/rss/abc/?$ /rss/abc/?type=555 [R=301,L]

Any pointers ? This is on a old TYPO3 site. Anyway it could hijack the request before doing the redirect ?

1 Answer 1

1

I can only recommend to use some kind of online htaccess rewrite rule checker, for example https://htaccess.madewithlove.com/ (not the only one, and no real preferance or recommendation about others).

Your rewrite rule is wrong, it should be:

RewriteEngine On
# Redirects rss
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^rss/abc/?$ /rss/abc/?type=555 [R=301,L]
Sign up to request clarification or add additional context in comments.

1 Comment

I'm crazy. I already tried without the leading slash and it wasn't working. That's why I then tested with the / at the begin (tha's where my copy/paste comes from). Anyway I moved my redirect up in the .htaccess and retried without the slash and it worked. It's either i didn't test properly the first time or some other redirection was interfering. Anyway thank you very much !! :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.