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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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$

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.