1

If user request existing php code, which I placed right in the root:

  • domain.com/images/pic1.jpg
  • domain.com/anyphp.php
  • domain.com/someapp/somecode.php
  • domain.com/anything.someExt
  • etc

don't do anything,leave as it, they are working good.

But if he simply enter domain.com -> send him to domain.com/myNewApp/index.php, which is my cool new app. Don't rewrite the URL to domain.com/index.php because it is for my existing app.

I expect the answer may be super simple but I am just giving up trying

Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
Ip ziet
  • 307
  • 2
  • 13

2 Answers2

0

Do you have access to the Apache conf file? If so:

RewriteEngine  on
RedirectMatch ^/(.*)$ http://example.com/myNewApp/index.php

Should work.

Edit: This rewrite won't work. I never used the regex-capture. And I misread what you wanted. It looks like you found an answer, but this should still work if you change the regex to:

RewriteEngine  on
RedirectMatch ^/$ http://example.com/myNewApp/index.php

Check out this page for more re-writey goodness: http://httpd.apache.org/docs/current/rewrite/remapping.html

0

DirectoryIndex oxwall/index.php

Simple but it works

Phung D. An
  • 2,402
  • 1
  • 22
  • 23