I have links:
/admin/index.php
/admin/index.php?do=delete_user
/forum/index.php?search=aaa&type=a
/index.php
/index.php?p=home
and so on…
How to preg_replace() links that only index.php without GET’s will change (if have GET’s dont’replace).
Thanks, it’s working, but why not working this (?!&), (?!\&)? I want to keep unchange if after asd.aa/index.php?news=1 exist & (asd.aa/index.php?news=1&dont=change)
Use a negative lookahead:
'/index\.php(?!\?)/'will match only if there is no?after theindex.php