Hello

I have a site with dynamic content with URLs such as /country_details?countryID=100

Is there any way I can change this URL to country_details/100 so that google etc find it easier to crawl?

Thanks

R

Comments

Abilnet’s picture

>administer
>>settings
>>>General settings
>>>>Clean URLs: --> Enabled
(there's a test you need to run before you can enable it)

In addition of the above, when you'll create content, there's an "URL path settings" where you can change the actual URL as you like.

revival’s picture

Hi there

I've enabled clean urls. So my url looks something like:

http://www.mysite.com/country_details?country=100

(I pick up content from database tables that include content).

So I've disabled the ?q= drupal stuff, but want my url to look like:

http://www.mysite.com/country_details/100

Any ideas?

Thanks

R

Abilnet’s picture

Just go and edit your content pages (nodes) ...there's the "URL path settings" ...write there the URL you want. Should work.

Coldice4678’s picture

Pathauto module will automatically change all your path name for you. Can check out the views modules, I haven't got to far with it, but it allows urls to be broken down in to argurments, so the view module can automatcally read them.

cmsproducer’s picture

clean URLs will work, but you must have some kind of URL rewriting option available on your web server. Assuming you are in apache, mod_rewrite must be available (usually is), and you should edit the .htaccess file in the Drupal site to properly configure the folder hierarchy.
-----
iDonny - Web Content Management System Design, Development. & CRM

marcoBauli’s picture

Hello,

can i ask you what module generates that kind of "country_details?countryID=100" instead of the standard "node/100" one ?

..this thing freaks me a bit out, as i've never seen such kind of link..

tx

- Marco

revival’s picture

Hi there

The actual link is http://www.passportstamp.com/country_info&countryID=14

Basically it's a node with a URL alias with php with a $_GET['countryID'].

What I'd ideally like would be http://www.passportstamp.com/country_info/14

Agree it's non-standard Drupal here -- so I suppose I'll need to do a URL rewrite? If any Drupal way of doing it, I'd be grateful to hear!

Thanks

passportstamp.com Admin

coreyp_1’s picture

It appears that you have simply put php code into a node body (node/2, to be exact).

There is a "Drupal" way to do this, but my solution would have you create a custom module.

Before I begin, it would probably be helpful to see the module examples if you are not familiar with their construction.

Just define a callback with the path "country_list". Suppose that this callback points to a function called country_list_page(). Drupal works in a way so that, whenever the path "country_list" is requested, any extra arguments are passed to the function in question.

for example: if, in your module, you setup your callback function like this:


function country_list_page($countryID='A'){
  // Include your code here
}

Then, when a person requests a page like www.passportstamp.com/country_list/45, then the function country_list_page(45) will be called.

If a person requests a page like www.passportstamp.com/country_list/E, then the function country_list_page('E') will be called.

If a person only requests www.passportstamp.com/country_list, then the function country_list_page() is called without any arguments. In this case, because of our function declaration in the custom module, $countryID will default to 'A'.

I hope I haven't made this too complicated. It's really an easy thing to do, once you've done it. ;o) Just ask if you have any questions.

-Corey