php - htaccess exclude a page from rule -


options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritecond %{http_referer} !^http://(www\.)?pirate-punk.com(/)?.*$     [nc] rewriterule ([^/]+\.[a-z0-9]+)$ http://www.pirate-punk.com/dl.php?f=$1 [r,nc,l]  options +indexes  

this htaccess redirect incoming traffic page if come different domain.

i exclude index.php pages rule visitors can still visit index.php page if come outside of domain

how can ?

you can add condition excludes ends / or /index.php:

rewriteengine on  rewritecond %{request_uri} !/(index\.php)?$ rewritecond %{http_referer} !^http://(www\.)?pirate-punk.com(/)?.*$     [nc] rewriterule ([^/]+\.[a-z0-9]+)$ http://www.pirate-punk.com/dl.php?f=$1 [r,nc,l] 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -