1

Is there a way to redirect all links from: mydomain.com/dir/$$$$$$$$$$ to mydomain.com/dir/index.php ?

$$$$ = whatever is written
So, if someone try to access mydomain.com/dir/15019510591 he will be redirected to mydomain.com/dir/index.php.

Please keep in mind that I want to redirect links only from /dir/, and not root/home page.

Bog Otac
  • 15
  • 5

2 Answers2

1

Just create an .htaccess file in your dir/ directory with the following content:

RewriteEngine on
RewriteRule ^.*$ index.php

Make sure that mod_rewrite is enabled in your webserver.

How to enable mod_rewrite for Apache 2.2

cypryradu
  • 56
  • 3
0

You should just be able to use something like this:

RewriteEngine On
RewriteRule ^dir/(.*) dir/index.php [R=301,L]
Arun
  • 1,498
  • 1
  • 12
  • 16