Jump to content

what to Enter in .Htaccess file to get this Desired URL Structure?


Recommended Posts

Friends,

 

How you all?

 

My Existing URL Structure is:

http://mydomain.com/index.php?kw=anykeyword&p1=anyparameter1&p2=anyparameter2

 

 

I want this Structure to be like:

http://mydomain.com/index.php/anykeyword/anyparameter1/anyparameter2

 

BTW, Is the below Structure also Possible (It Will be Awsome to have the Below One.. If POssible)

http://mydomain.com/anykeyword/anyparameter1/anyparameter2.htm

 

 

 

What shall i Put in my .Htaccess file to achieve the same?

 

Please may someone help? Sure a Coffee/beer is deal, if you get to visit DC.

 

Thanks all you Geeks

Natty T

 

Link to comment
Share on other sites

The rewrite rule would be something like this..

 

RewriteRule ^([^/]+)/([^/]+)/([^/]+)\.html$ /index.php?kw=$1&p1=$2&p2=$3

 

hello,

 

I just tried this code, seems no luck, i still see the same URL structure....

 

http://mydomain.com/index.php?kw=Kitchen-Aid-Stand-Mixer-Hd-Series&p1=Kitchen-Aid-KG25H3XER-Empire-Red-Professioanl-HD-Series-Stand-Mixer&p2=B001OFV6QC

 

:'(

 

Any thoughts?

Link to comment
Share on other sites

You would, the purpose of the code is not to change the structure, but to make the new structure map to the old one. With that code, requesting...

 

http://mydomain.com/Kitchen-Aid-Stand-Mixer-Hd-Series/Kitchen-Aid-KG25H3XER-Empire-Red-Professioanl-HD-Series-Stand-Mixer/B001OFV6QC

 

...will display the contents of...

 

http://mydomain.com/index.php?kw=Kitchen-Aid-Stand-Mixer-Hd-Series&p1=Kitchen-Aid-KG25H3XER-Empire-Red-Professioanl-HD-Series-Stand-Mixer&p2=B001OFV6QC

Link to comment
Share on other sites

What you just said made lot of sense... I Appreciate...

 

Though, i am still not able to achieve this... coz i think i am doing something wrong in the below part:

$this->aws["template"] = str_replace("%%niceseolink%%",'index.php?".$kwtoken."."/".".$myprodtitle."."/".$myprodasin.".htm', $this->aws["template"]);	

 

I am passing the whole URL structure through %%niceseolink%% in a HTML Template...

 

Am sure there is smething wrong in this to confirm with :

 

RewriteRule ^([^/]+)/([^/]+)/([^/]+)\.html$ /index.php?kw=$1&p1=$2&p2=$3

 

May you help me Spot the Odd in my Code?  ;)

Link to comment
Share on other sites

$this->aws["template"] = str_replace("%%niceseolink%%",'index.php?".$kwtoken."."/".".$myprodtitle."."/".$myprodasin.".htm', $this->aws["template"]);   

 

So, yes  i am placing index.php in the link...

 

Is my Link formation Correct?

 

'index.php?".$kwtoken."."/".".$myprodtitle."."/".$myprodasin.".htm'

 

Link to comment
Share on other sites

As I have said now in my two previous posts, NO. The pattern provided doesn't expect index.php? to be in the URL, it should be of the form...

 

domain.com/$kwtoken/$myprodtitle/$myprodasin.html

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.