S
S
shobique2015-08-08 21:42:36
PHP
shobique, 2015-08-08 21:42:36

How to set up mod_rewrite with a redirect to the admin folder with your .htaccess?

There is a site, at the root is .htaccess with the following content:

<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^([a-z0-9_-]*)/?([a-z0-9_-]*)?/?([a-z0-9_-]*)?/?([a-z0-9_-]*)?/?([a-z0-9_-]*)?/?([a-z0-9_-]*)?/?$ /index.php?url1=$1&url2=$2&url3=$3&url4=$4&url5=$5&url6=$6 [L]
</ifModule>

It is necessary to make index.php open in the admin folder, which has its own .htaccess:
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^([a-z0-9_-]*)/?([a-z0-9_-]*)?/?([a-z0-9_-]*)?:?([a-z0-9_-]*)?:?([a-z0-9_-]*)?/?([a-z0-9_-]*)?/?$ /index.php?go=$1&file=$2&part=$3&sort=$4&page=$5&id=$6 [L]
</ifModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2015-08-21
@allokdog

Redirect 301 / www.site.ru/admin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question