0

So, I currently have an application running angular, and just developed a page that takes a get request.

Because users can go to this page, I needed to set up .htaccess to redirect to index.html, which I used

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA]

But, my API is also on the site (/api.php), and I was considering adding additional php files for organizational purposes

How do I make .php redirect to {{page}}.php and .html or no extension go to index.html?

  • Check this page - https://stackoverflow.com/questions/5745490/rewrite-rule-to-add-html-extension – Dmitry Leiko Nov 19 '19 at 09:13
  • Have you checked that? Also please clarify which page you want place redirect and the target. IMO it is configurable via angular itself, but if you add more PHP file and want to restructure your project. The q was answerable. – Adi Prasetyo May 20 '20 at 15:19

0 Answers0