adyre Posted August 31, 2007 Share Posted August 31, 2007 I have to rwrite something like this: index.php?pag=1&page=3 if I make this like this: /1/3/ my default directory for my <img> is /1/3/pictures/ but my img folder is /pictures/ Another problem is for JS src and CSS src.... I was adviced to use <base> but I wan't a rewrite solution, if it is (I'm new in rewriting). I can't use static src-s because my site rewrite condition can turn to /1/2/3/4/5/6 ... I thing you got the ideea. And another thig: Is there a merthod to make something like this: RewriteRule ^notebook$ index.php?act=notebook&id=6 but making something like switch($act) { case('notebook'): $id=1; break; case('laptop'): $id=2; break; } but in the .htacces file, or how do I write a rule that for example I have index.php?act=pc[space]hardware&id=5 to replace with /pc-hardware/, replace space with "-". Quote Link to comment https://forums.phpfreaks.com/topic/67509-rewrite-problem-trailing-slash-set-directory/ Share on other sites More sharing options...
hackerkts Posted September 1, 2007 Share Posted September 1, 2007 I don't understand what you're trying to say, as for your CSS ects.. Put the full URL. Any don't use space for URL, convert all the URLs with space to - or _ . Quote Link to comment https://forums.phpfreaks.com/topic/67509-rewrite-problem-trailing-slash-set-directory/#findComment-339327 Share on other sites More sharing options...
adyre Posted September 3, 2007 Author Share Posted September 3, 2007 Thanks.. I thought about that.. .I started to analize site's using mod_rewrite and I found out that every one of this sites has the full adress of the srcs..... Now I made for myself an ideea. I put an $domain="http://localhost/" on the top of the page, and when I will put it on the server I will replace it with the domain that I want.... I use the domain in everything: hrefs, src etc. Thanks for your intervension. Quote Link to comment https://forums.phpfreaks.com/topic/67509-rewrite-problem-trailing-slash-set-directory/#findComment-340328 Share on other sites More sharing options...
d22552000 Posted September 4, 2007 Share Posted September 4, 2007 frankly to ask for css ro js in my server you have to go through quite a process mainsite/javeascript/base/requesturi *required* /js/etc/*.js if you dont have the requesturi of the page asking for it, your request is denied. mainsite/cascading/style/sheet/s/base/host/requesturi/css/main/style.css I love base_rewrite!!! I have soemthing like .\css$ cascading/style/sheet/s/base/host/$requesturi$/css/mail/.\css$ Quote Link to comment https://forums.phpfreaks.com/topic/67509-rewrite-problem-trailing-slash-set-directory/#findComment-341354 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.