regex - mod_rewrite page beautifying -


So I'm stuck I'm not usually good with mod_rewrite or regular expression, and this is giving me problems

I need a redirect like URL domain.com/view/Some_Article_Name.html

domain.com/index.php? P = see & amp; Id = some_article_name

This is the rule that I have worked fine now, but it also rewrites my stylesheets and images and accessories that should not be re-written.
rewrite ^ / See ([^ /] *). Html $ /index.php?p=view&=id=$1 [L]

This should only redirect the page to domain.com/view / * Together. I think that all I need is a rewrite, but I think that works can not seem to make one. What do I need to do to do this without writing a rewriterule for every person file? Br
My rewrite statement for this

I suspect that this stylesheet and images are being influenced by this rule. Because this will mean that the URL path of your stylesheets and images ends with .html . Because otherwise the rules will not apply.

I think you are using relative paths to reference stylesheets and images such as " ./css/style.css or images / foo / Bar.png . This relative URL path is resolved with the original URL path and it is the URL path of the current document.

There was only one path segment in your original URL path and From that time on, all the relative URL paths were used, but now you have another route segment ( / view>) and rish The tricky path is sorted through that path. So, ./css/ style.css or images / foo / bar.png can now be used with / view / css / Style.css and /css/style.css instead of / view / images / foo / bar.png and / images / foo / bar .png was with /index.php .

Solution: /css/style.css or Use full URL paths such as images / foo /bar.png There may be a way in the original URL with such a URL path to refer to your external resources and the resources are always correct. Are resolved.


Comments