Question:
mod_rewrite - help with css and links?
cjconnor24
2009-05-21 11:24:36 UTC
hey im after some help with mod_rewrite on my site.

www.mysite.com/about.php
www.mysite.com/contact.php

you get the idea - i want to be able to rewrite these as

www.mysite.com/about/
www.mysite.com/contact/

however i also have a page which looks like this:

www.mysite.com/portfolio.php?p=2

i want to rewrite this as
www.mysite.com/portfolio/2/

now the tricky part - how do i get my css and images no work?

i have got the rewrite rules but for some reason the css and any images are broken.

I've spent days on google but just can't get to the bottom of it.

Your help would be much appreciated!
Three answers:
sjamms
2009-05-21 11:31:58 UTC
Since you're rearranging all the directories, unless the css/links/images have relative path positioning, you will have to manually go in and change each faulty piece of code by hand.
?
2016-11-08 14:27:06 UTC
it quite is totally as much as the content fabric-form sent by employing the server to the browser. For each thing you bypass to, notwithstanding if its a picture, html web site, zip document, and so on a content fabric-form is sent. From there the browser handles the content fabric. So in the experience that your server is configured to deliver Hypertext Preprocessor archives with an HTML content fabric form, the browser treats it as HTML. additionally, Hypertext Preprocessor, ASP, and so on pages can redefine the content fabric-form to deliver issues after particular processing (at the same time with pictures).
LemonPro
2009-05-21 11:32:49 UTC
in first case you need to make folder as /contact/ or /about/ and rename contact.php to index.php.



The second one is PHP generated file, so if you want to /portfolio/2/ then remove php stuff and make it in plain HTML and create folders...like /portfolio/2/ which are folders and make p=2 content on html format to name it index.php


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...