Server issue adding backslash to end of RSS url breaks it

dethfire

Well-known member
Affected version
1.5.21
This is troublesome when apache redirects automatically add in the backslash to your final destination

ex.

Code:
RewriteRule ^external.php* https://www.physicsforums.com/forums/-/index.rss [R=301,L]

turns into

Code:
https://www.physicsforums.com/forums/-/index.rss/

and will break
 
That doesn't look right at all. Even the regex is invalid. Aren't you looking for something more like this?
Code:
RewriteRule ^/external\.php$ /forums/-/index.rss [R=301,L]

  • * probably doesn't work the way you think; it repeats the previous character 0 or more times, so external\.php* would match would match external.ph, external.php, external.phpppp, etc.
  • . is a wildcard matching any non-line-breaking character, so it needs to be escaped with a backslash
  • While Apache historically allowed matching without a leading slash, for consistency, it should be used
  • $ matches the end of the URI. RewriteRule doesn't match against querystrings, so you can omit the wildcard at the end.
  • You probably don't want a fully-qualified URL in your redirect.

If it's still not working, you probably have other rules that are messing it up. Paste your whole .htaccess and I'll try to help.
 
That doesn't look right at all. Even the regex is invalid. Aren't you looking for something more like this?
Thanks for your help and I will look into your suggestions. Amazingly it does work though. But your suggestions do not address the issue and that is apache adds a backslash to index.rss/ and then the rss page breaks.
 
But your suggestions do not address the issue and that is apache adds a backslash to index.rss/ and then the rss page breaks.

I figured. It sounds like you might have a variety of inconsistencies in your .htaccess. If you post it here, I can try to do a little cleanup for you.
 
You would need to address whatever issue is adding the trailing slash. The slash changes the meaning of the URL to the route system.
 
Top Bottom