Reply to Re: mod_rewrite problem

Your name:

Reply:


Posted by Rik Wasmus on 08/30/07 10:59

On Thu, 30 Aug 2007 12:31:34 +0200, luigi7up <luigi7up@gmail.com> wrote:=


> Hello everyone,
>
> Im havin' problem with images in pages that were mod_rewrite-n.
>
> So,
>
> /blog/3/
>
> is rewritten into
>
> index.php?kom=3Dblog&id=3D3
>
> in .htaccess with directives:
>
> RewriteRule ^blog/$ index.php?kom=3Dblog [L]
> RewriteRule ^blog/(.*)/$ index.php?kom=3Dblog&id=3D$1 [L]
>
> but images that have relative path <img src=3D'images/image.jpg' /> ar=
e
> problem because server appends image path to virtual directory /blog/
> 3/:
>
> /blog/3/images/image.jpg
>
> where I want it to append that path to the root:
>
> www.domain.com/images/image.jpg
>
> I would like to solve this through .htaccess.

Why? Can't you just use <img src=3D'/images/image.jpg' />?

> I tried solving this problem with entering apsolute paths to my images=

> but Im unable to put apsolute path because Im using TinyMCE .js editor=

> that resolves all absolute paths into relative ones..

TinyMCE is perfectly configurable.
...
relative_urls: false,
document_base_url : "/",
...

> Also using slash in front of path (/images/image.jpg) isn't solving my=

> problem.

It should. What's going wrong.

> I found RewriteRule that should solve my problem but it doesn't work.
> Here it is:
>
> RewriteCond %{REQUEST_URI} !\.(exe|jpg|jpeg)$

Which does not do what you think it does.

>
> Maybe Im not using it right, I don't know but this problem gives
> headache for quite some
> time now.

As said, go for the src=3D'/images/image.jpg' solution.

..htaccess is possible, but very kludgy.

RewriteRule ^blog/images/(.*)$ images/$1 [L]
RewriteRule ^blog/$ index.php?kom=3Dblog [L]
RewriteRule ^blog/(.*)/$ index.php?kom=3Dblog&id=3D$1 [L]
-- =

Rik Wasmus

My new ISP's newsserver sucks. Anyone recommend a good one? Paying for =

quality is certainly an option.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация