this may sound questing has been asked many times before want specific. want redirect requests "directory" root, e.g:
http://example.com/sub/12345.html -- restricts --> http://example.com
http://example.com/sub/foobar.php -- redirects --> http://example.com
http://exmpale.com/othersub/foo -- should not redirect!
the catch don't want url change, contents. visitors should see url enter in address bar website index contents. .htaccess file contains rewrite handle happens if use emits file type. don't know if interfere want i'll provide clarification.
options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{request_filename}.php -f rewriterule ^ %{request_uri}.php [l] thanks in advance!
you need new rule handle rerrite:
options +followsymlinks -multiviews rewriteengine on rewritebase / rewriterule ^sub/.+$ / [l,nc] rewritecond %{request_filename}.php -f rewriterule ^ %{request_uri}.php [l]
Comments
Post a Comment