regex - URL rewriting to a folder if url has one pattern and ignore the rule if url has another pattern -
i have following directory structure project
example admin/ cdn/ client/ .htaccess when url
http://192.168.1.121/example/orhttp://192.168.1.121/exampleorhttp://192.168.1.121/example/category/productnameorhttp://192.168.1.121/example/content/12, on,
it should rewrite client/ folder.
but if url has http://192.168.1.121/example/cdn, should ignore rule.
can me on this. how write rule in .htaccess
thanks
you can use /example/.htaccess:
rewriteengine on rewritebase /example/ rewriterule ^(?!client/|cdn)(.*)$ client/$1 [l,nc] (?!client/|cdn) negative lookahead ignore rule when uri /example/cdn or /example/client
Comments
Post a Comment