07-19-2023, 11:36 PM
I need to alter this current re-write rule to accommodate for an admin folder. Here is my current mod-rewrite code:
<pre>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]+?)/([a-z]+?)/(.*)$ index.php?model=$1&view=$2&params=$3 [L,NS]
</pre>
I have this folder structure:
<pre>
ROOT:
If the .htaccess file is in the "admin" folder it works correctly. I get:
<pre>
URL:
Array
(
[model] => faq
[view] => edit
[params] => 13/asc
)
</pre>
But, when its in the root folder I get:
<pre>
URL:
Array
(
[model] => admin
[view] => faq
[params] => edit/13/asc
)
</pre>
I want the mod-rewrite to recognize that admin folder and is an actual directory and use a separate re-write rule.
Thanks in advance.
<pre>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]+?)/([a-z]+?)/(.*)$ index.php?model=$1&view=$2&params=$3 [L,NS]
</pre>
I have this folder structure:
<pre>
ROOT:
[To see links please register here]
ADMIN:[To see links please register here]
</pre>If the .htaccess file is in the "admin" folder it works correctly. I get:
<pre>
URL:
[To see links please register here]
(NOTE:[To see links please register here]
)Array
(
[model] => faq
[view] => edit
[params] => 13/asc
)
</pre>
But, when its in the root folder I get:
<pre>
URL:
[To see links please register here]
(NOTE:[To see links please register here]
)Array
(
[model] => admin
[view] => faq
[params] => edit/13/asc
)
</pre>
I want the mod-rewrite to recognize that admin folder and is an actual directory and use a separate re-write rule.
Thanks in advance.