Jump to content

Recommended Posts

I have tried to created friendly urls by editing the .htaccess file and writing in it:

 

RewriteEngine On

RewriteBase /SITES/Starservice/

 

RewriteRule ^home/([^/]+).html home.php?page=$1 [L]

RewriteRule ^home/([^/]+)/([^/]+).html home.php?page=$1&vettura=$2 [L]

RewriteRule ^home/([^/]+)/([^/]+)/([^/]+).html home.php?page=$1&vettura=$2&cat=$3 [L]

RewriteRule ^home/([^/]+)/([^/]+)/([^/]+)/([^/]+).html home.php?page=$1&vettura=$2&cat=$3&ltb=$4 [L]

 

 

and have changed my links into  home/offerte.html    home/offerte/eurocargo.html    ecc.

 

The problem is that every time i click on a link the links in the following page (which should be the same) stack another    home/  creating links like: home/offerte.html    home/home/offerte.html  home/home/home/offerte.html

 

as you can see from the rewriterules  the page (home) is always the same but depending on where the link is from it has more or less variables passed.

 

How do i have to code the rules to make it work properly?

 

thank in advance

Link to comment
https://forums.phpfreaks.com/topic/249546-help-with-rewrite/
Share on other sites

I dont get the 404 that was a problem i solved.

I did change my links and they all look like :

 

home/foo/bar

home/foo/bar/gig

home/foo/bar/gig/tak

ecc

 

The weird thnig is that every time i use one of these links, the links in the following page stack a home/ inside

so they look:

 

home/home/foo/bar

home/home/foo/bar/gig

home/home/foo/bar/gig/tak

 

and after i click on any of these in the next page they become:

 

home/home/home/foo/bar

home/home/home/foo/bar/gig

home/home/home/foo/bar/gig/tak

 

dont i have to put a rewritecond to check how many sub cat are in the url? so to check if its  home/foo or home/foo/bar or home/foo/bar/gig ? I dont know if its the right solution but even if it is i dont know how to apply it ^^

help!

Link to comment
https://forums.phpfreaks.com/topic/249546-help-with-rewrite/#findComment-1281219
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.