Jump to content

Url rewrite with relative link handle


londonline

Recommended Posts

I have write down this to handle the relative links

for the url rewrite requests but I don't know if it is correct..  :o

Do I need to move all the "relative link  handler" at the bottom of the script?

This is my first url rewrite, please, help!!!!

Thanks

 

[pre]

RewriteEngine On

Options +FollowSymlinks

RewriteBase /

RewriteRule ^telefonia_aziende/gestori/regione([^/_]+)_connessione([^/_]+)_pagina([^/_]+).html?$ elenco.gestori.telefonici.php?reg_id=$1&conn_id=$2&pag=$3&giur_id=2 [L]

RewriteRule ^telefonia_aziende/gestori/(.*)$  http://www.mysite.net/$1  [R]

 

RewriteRule ^telefonia_privati/gestori/regione([^/_]+)_connessione([^/_]+)_pagina([^/_]+).html?$ elenco.gestori.telefonici.php?reg_id=$1&conn_id=$2&pag=$3&giur_id=1 [L]

RewriteRule ^telefonia_privati/gestori/(.*)$  http://www.mysite.net/$1  [R]

[/pre]

Link to comment
https://forums.phpfreaks.com/topic/93650-url-rewrite-with-relative-link-handle/
Share on other sites

In another post I found this solution:

[pre]You need to specify the base URL for all relative links in a page using the <base> html tag.

In my case I put this tag into my header template file which is the same for all my pages.

<head>

...

<base href="http://site.com/base/" />

....

</head>[/pre]

 

Can anyone tell me what's the best solution? This solution or the rewrite rule

[pre]RewriteRule ^telefonia_aziende/gestori/(.*)$  http://www.mysite.net/$1  [R][/pre]

 

Which is better for performance and cross-browser/user friendly?

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.