0

Could you help to make redirect on php script. For example if go to http://domain.com/dir/subdir/ .htaccess will move me to php script with get request like http://domain.com/index.php?url=/dir/subdir/ Sorry for my bad English)

Subirdcom
  • 91
  • 6
  • 1
    Are you asking how to use .htaccess to rewrite requests? If so, can you provide your current contents of .htaccess and what you have tried? – Jeff Lambert Nov 25 '15 at 16:42
  • 4
    Possible duplicate of [How to make a redirect in PHP?](http://stackoverflow.com/questions/768431/how-to-make-a-redirect-in-php) – Don Scott Nov 25 '15 at 16:42

3 Answers3

0

Do you mean something like this?

#.htaccess file
RewriteEngine On
RewriteRule ^/ index.php

Now you can extract the arbitrary URL parameters in your index.php?

sradforth
  • 2,176
  • 2
  • 23
  • 37
0

Try to write this in your .htaccess file :

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1
raph77777
  • 111
  • 1
  • 8
0
RewriteEngine On
RewriteRule ^$ index.php?url=$1 [L,R=301]
Fahed Alkaabi
  • 269
  • 2
  • 10