Htaccess Rewrite Rule REQUEST URI Problem

if the site name does not have a UQUQUEST URI then index.php should appear else if the url example.com/key should contain a pages.php file? tkey =.

When I install this way, images in subfolders are not loaded

RewriteRule ^/?$ index.php [L]
RewriteRule ^(.*)$ pages.php?page_keytkey=$1 [L]

      

I ask for advice

+3


source to share


1 answer


Try to prevent the recursive loop that Peter Simkowski pointed out . Also think, not by redirecting existing files as Michael Berkovskiy, .

RewriteRule ^/?$ index.php [L]
RewriteCond %{REQUEST_URI} !^/pages.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ pages.php?page_keytkey=$1 [L]

      



You can check out http://wiki.apache.org/httpd/RewriteCond for more details .

+3


source







All Articles