Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,167,136 members, 7,867,282 topics. Date: Friday, 21 June 2024 at 01:25 PM |
Nairaland Forum / Science/Technology / Webmasters / Prevent Mod_rewrite From Rewriting Image Links (706 Views)
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)
Prevent Mod_rewrite From Rewriting Image Links by ivcraig(m): 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(m): 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(m): 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> 1 Like |
Re: Prevent Mod_rewrite From Rewriting Image Links by ivcraig(m): 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:
|
(1) (Reply)
Ask Questions On Website Development (HTML, Jquery, Javascript, PHP, Mysql) Etc. / Any Page Or Group For Sell Ping Here / This New Affiliate Company Pays You 500 When You Register
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11 |