regex - Why does this modrewrite affect other files? -
i have been using following code rewrite request variable in nested directory.
rewriteengine on rewriterule ^demos/folder1/page\.php$ - [l] rewriterule ^demos/folder1/([^/]+)/([^/]+)$ demos/folder1/page.php?slug=$1 [nc] rewriterule ^demos/folder1/([^/]+)$ demos/folder1/page.php?slug=$1 [nc] /* ruins everything, other links *
this located in .htaccess file in root directory, not /folder1/. idea why causing other .php files on server not display? need requests /demo/folder1/page.php rewritten /demo/folder1/request. missing?
thank in advance!
try code:
rewriteengine on rewriterule ^demos/folder1/page\.php$ - [l,nc] # skip files , directories rewrite rules below rewritecond %{request_filename} -d [or] rewritecond %{request_filename} -f rewriterule ^ - [l] rewriterule ^demos/folder1/([^/]+)/?$ demos/folder1/page.php?slug=$1 [qsa,nc,l]
Comments
Post a Comment