w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Redirecting folder to another folder avoiding other .htaccess rules

Okay, let's look at it step by step.

First let's scrap this rule, which is ungrammatical because it uses regex on the right side:

RewriteRule  %{REQUEST_URI}^/?editor/(.*)$ (.*)/editor/$1 [R,L]

The second rule can be abridged to this:

RewriteRule ^/?$ ?p=homepage [L]

The third rule can be rewritten like so:

RewriteRule
^(?!(?:index.php|editor|css|pdf|eshot|js|fonts|images))([^/.]+)/?$
index.php?p=$1 [L]

Summarizing, it looks to me like you could abridge your rules like so:

DirectoryIndex index.php
RewriteEngine On
RewriteRule ^/?$ ?p=homepage [L]
RewriteRule
^(?!(?:index.php|editor|css|pdf|eshot|js|fonts|images))([^/.]+)/?$
index.php?p=$1 [L]




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.