Jump to content

Rewrite problem - trailing slash set directory


adyre

Recommended Posts

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 "-".

 

 

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.

frankly to ask for css ro js in my server

 

you have to go through quite a process :D

 

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$

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.