Prevent Mod_rewrite From Rewriting Image Links - Webmasters - Nairaland
Nairaland Forum › Science/Technology › Webmasters › Prevent Mod_rewrite From Rewriting Image Links (817 Views)
| Prevent Mod_rewrite From Rewriting Image Links by ivcraig(op): 4:53pm On Feb 16, 2016 |
Hello guys. I'm trying to cleanup my the links on a website I'm working on, using htaccess . My rewrite rule works fine, but the images on the page don't display because a part of image links are also rewritten. |
| Re: Prevent Mod_rewrite From Rewriting Image Links by vicsrael: 6:30pm On Feb 16, 2016 |
there is a way to exempt physical files Google it |
| Re: Prevent Mod_rewrite From Rewriting Image Links by ivcraig(op): 7:20pm On Feb 16, 2016 |
vicsrael:I've tried all methods I found online. None seems to work. |
| Re: Prevent Mod_rewrite From Rewriting Image Links by ivcraig(op): 12:04am On Feb 18, 2016 |
I tried this but it didn't work. Rewriterule ^tracks-([0-9]+)+([0-9a-zA-Z_-]+)$ This worked tho: Rewriterule ^tracks/([0-9]+)/([0-9a-zA-Z_-]+)$ I changed the slashes to dashes. I guess the slashes convert the link to directories, which also reroutes all files on the page. |
| Re: Prevent Mod_rewrite From Rewriting Image Links by vicsrael: 9:34am On Feb 18, 2016 |
try this <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> |
| Re: Prevent Mod_rewrite From Rewriting Image Links by ivcraig(op): 7:27pm On Feb 18, 2016 |
vicsrael:Thanks man. What's the advantage of this over the solution I got. I'm very interested in making positive changes and learn new stuff. From the looks of this one it seems I can easily redirect all my links. |
| Re: Prevent Mod_rewrite From Rewriting Image Links by vicsrael: 12:17pm On Feb 20, 2016 |
ivcraig:ye is good you can chat me up on whatsapp 08130687861 |
| Re: Prevent Mod_rewrite From Rewriting Image Links by Nobody: 3:06pm On Feb 20, 2016 |
ivcraig:
|
Efficient Strategy To Have Good Links • Ransomware Attacks 2017: What Is Ransomware And How To Prevent, Stop Ransomware • Easy Way To Convert Image Texts To Normal Plain Texts • 2 • 3 • 4
Who Have Union Bank Current Account • How Would You Design This Better? • .