Jump to content

URL rewriting - Ionic Isapi Filter help


denny911

Recommended Posts

Hello to everyone! After my questioning about mod_rewrite for my site, my hosting provider decided to implement this. They came across Ionic Isapi Filter but they seem not to be skillfull about it.After enabling direct access to the config (.ini) file of the filter to me, i was advised to seek for help here since they just don't know how to do it. What i need follows right below.I need my current links, that look like this: /show.php?cat=something&type=sometype&city=somecity&letter=P convert to something like this:/show(.php)/something/sometype/somecity/P(.html)/It really doesn't matter the exact look of the link - i need some starting point here. All they (my hosting provider) HAD managed to do is to provide me with some code that they got out of some test version of their Joomla site but they think it is not appropriate for my site. I tried to add it to .ini file but it does absolutely nothing for my site.The code is:RewriteCond %{URL} ^(/component/option,com) [NC,OR] ##optional - see notes##RewriteCond %{URL} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule /tesla/(.*) /tesla/index.php [L,U] (i changed this line to /(.*) /index.php because i need this to work for the root of my site)So, since they insist on my coming here and asking for advice, here i am. I hope someone will be kind enough and help me. If nothing else, it will be highly appreciated!Denis K.

Link to comment
Share on other sites

According to the readme, the configuration ini file must be in the same folder as the DLL and with the same name.And the directives are the same as mod_rewrite, so if you know them, you should know how to create an ini file as well.Your particular example is simple though. Here it is:

RewriteRule /(.+)/(.+)/(.+)/(.+)/(.+)/ /$1.php?cat=$2&type=$3&city=$4&letter=$5

This will map

/show/something/sometype/somecity/P/

to

/show.php?cat=something&type=sometype&city=somecity&letter=P

I'm not sure about the effects of missing items in the URL though. By that I mean that I don't know what would happen if, say, the letter of the city was missing, turning the complete URL into something like:

/show/something/sometype/somecity/

There's another way with which you can do something which "looks like" URL rewriting, if you can just swallow the .php and the "?". You can simply do:

/show.php?/something/sometype/somecity/P/

And from within PHP, look into the

$_SERVER['QUERY_STRING']

variable, dividing the complete query string into the tokens you have now.In combination with rewriting modules and this, you can get a very flexible system. Probably more flexible than those things alone. If you decide to go with this, the easiest rewriting rule I can think of would be something like:

RewriteRule /(.+)/ show.php?$0

("0" means "the complete string that was matched")

Link to comment
Share on other sites

this is getting more and more frustrating.. even your code doesnt work.it may be the installation that is set up wrong. I already have the .ini file and im able to write to it but that your line of code just doesnt seem to work!Any other suggestions? Consider that the 4 lines of code (from my 1 post) are excerpted from the Joomla test site and they work! I know that because the .ini file is the same for MY site and that TEST site (the test site belongs to my hosting provider - they gave me access to it so i could set the .ini file up myself).but i just dont know why nothing works? Help please!

Link to comment
Share on other sites

Think he wants it the other way round

RewriteRule /(.+?).php?cat=(.+?)&type=(.+?)&city=(.+?)&letter=(.+?) /$1/$2/$3/$4/$5/

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...