londonline Posted February 29, 2008 Share Posted February 29, 2008 I have write down this to handle the relative links for the url rewrite requests but I don't know if it is correct.. 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 More sharing options...
londonline Posted February 29, 2008 Author Share Posted February 29, 2008 Is it the right way to handle links with relative paths? ??? Link to comment https://forums.phpfreaks.com/topic/93650-url-rewrite-with-relative-link-handle/#findComment-479971 Share on other sites More sharing options...
londonline Posted March 1, 2008 Author Share Posted March 1, 2008 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? Link to comment https://forums.phpfreaks.com/topic/93650-url-rewrite-with-relative-link-handle/#findComment-481163 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.