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)
Asked
Active
Viewed 68 times
0
-
1Are 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
-
4Possible 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 Answers
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
-
-
That means it is the Last rewrite rule and stops looping and/or conflicts. And R is for redirect – Fahed Alkaabi Nov 26 '15 at 14:08