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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -