1

If the URL ends in .HTML I have no problem controlling it and redirecting it within Joomla. But if ends in .PHP I get the 404 page.

I assume it can be fix one of two ways: 1. Give Joomla control of URLs ending in PHP so that I can redirect the URL from within Joomla or 2. Try to do it within the NGINX config:

location / {
try_files $uri $uri/ /index.php?$args;
}

location /oldsignup.php {
   rewrite ^/.* http://example.com/signup.html permanent;
}

location /oldsignup2.php {
   rewrite ^/.* http://example.com/signup.html permanent;
}

I tried the above but it failed.

Frank Barcenas
  • 605
  • 6
  • 18
  • 1
    Can you please expand on "failed". What failed - did it do anything? What do the logs say? What you have you tried to address it - have you done debugging to see if the problem is the rewrite regex or the location block match regex? – Tim Aug 24 '17 at 23:10
  • @Tim Thanks I think I figured out how to do it with-in NGINX. Now I just need to figure out how to pass that control to the URL Rewrite Component within Joomla so I don't have to make these manual adjustments within the NGINX config. – Frank Barcenas Aug 24 '17 at 23:14
  • A friendly suggestion - if it only takes you 15 minutes to work out the answer to a question, perhaps you should put in a little more effort before taking the time to post the question. Your call, of course, sometimes writing a question helps work out the answer. – Tim Aug 24 '17 at 23:22
  • You need quite a complex setup to pass the control of `.php` URLs to Joomla. First you would need to use `try_files /index.php$is_args$args;`, and then define `location` blocks for all static resources, where you would use `try_files $uri $uri/`. – Tero Kilkanen Aug 25 '17 at 09:57

1 Answers1

2

Fixed it with:

rewrite ^/oldsignup1.php$ http://example.com/signup.html permanent;
rewrite ^/oldsignup2.php$ http://example.com/signup.html permanent;

location / {
try_files $uri $uri/ /index.php?$args;
}
Frank Barcenas
  • 605
  • 6
  • 18