0

I'm using Pathauto module to set the URL for the nodes in my site. I have already created about 20,000 nodes in my site. Usually, the Pathauto module doesn't allow to the users to create the node with existing URL by giving the error as "Path already in use". But in my case, I can change the URL of a node with an existing URL of a node. For example parks located in same country,

  1. Gandhiji Park - /gandhiji-park (located in state1)
  2. Gandhiji Park - /gandhiji-park-0 (located in state2)

    I can change the URL of the park in state2 as /gandhiji-park and the node is saved in that URL.

If I search for gandhiji park in state2 the search filters out the park but the URL took me to park in state1.

Can anyone help me in this?

  • If you can create multiple aliases with the same URL, then this sounds like a bug. Have you filed a bug report in the pathauto issue queue? – user7667 Jul 18 '12 at 17:27
  • How did you change the URL of the park in state2 ?? – BEFL Jul 18 '12 at 20:37
  • @coleopterist,No I still didn't filed a bug report.I wanna check if this is a real bug or not so only posted to clarify this and I thought i made a mistake somewhere else in this module settings. – Ranjani Jul 19 '12 at 8:24
  • @Sharanc25,I go to the gandhiji park node at state2 and edited the node and in URL Path setting,unchecked the Automatic alias and changed it to the url of already existing one.It doesn't gives any error. – Ranjani Jul 19 '12 at 8:32
  • Can u post the full url ? Also Do both the nodes belong to the same content type ? – BEFL Jul 19 '12 at 8:37
2

I faced the same problem in my website. As you mentioned in your question :

Usually, the Pathauto module doesn't allow to the users to create the node with existing URL by giving the error as "Path already in use"

This is true only when you hand code the URL alias. If "Generate automatic URL alias" box is checked then similar URL's are appended with numbers at the end (like in your case).

The method I used to prevent this problem was to install a module called Unique field which makes sure the no 2 nodes have the same title(and thus unique URL for each node).

In your case, since the damage is already done, the best option for you is to change your title or url to something like /gandhiji-park-state-2

Suggestion :

This is just a suggestion for URL structure and SEO. A general rule of thumb that I follow when creating URL, is to rank the keywords in the URL. The highest ranked keyword should come at the end of the url. For example www.example.com/less-specific-keyword/more-specific-keyword. This way you can rank higher in search engines for the same content and also users can get an idea about your content just by looking at the url. For example, in your site you can structure the URL like this www.example.com/state/park/park-name.

  • Yes Sharanc25.The two nodes belongs to same content type named "parks". First park in state1 is www.sitename.com/gandhiji-park.The second one in state2 has www.sitename.com/gandhiji-park-0. – Ranjani Jul 19 '12 at 8:43
  • 1
    This might be a glitch in drupal. It happens all the time when I develop a website. It can be caused by a lot of factors, maybe you installed a module that conflicts with path auto or you didn't uninstall a module correctly, etc. Right now the best option for you is to change your title or url to something like /gandhiji-park-state-2. – BEFL Jul 19 '12 at 8:51
  • OMG!:( Actually my client don't like to change the title so better going to change the url as you said.Anyway Thanks for your posts Sharanc25. – Ranjani Jul 19 '12 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.