Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

drupal prepending 'node' to the link url

I am working on a drupal site. The current issue is that when a link is created either by using the url() or the base_path variable, it works ok on local development environment but when the very same code is put on the server, the url prepends node string in the path.

e.g. the path is <drupal site>/latestnews . The generated path is <drupal site>/node/latestnode and when clicked, it shows the page not found error. However would like to mention that the links work fine (i.e generate correct path) when clicked from the home page.

any help would be appreciated. If it helps, I am using Pantheon hosting for testing.

like image 665
Abdul Ali Avatar asked Jan 20 '26 06:01

Abdul Ali


2 Answers

Does the server by chance have the pathologic module enabled? That module's job is to rewrite links for different locations. It may be misconfigured. If it is enabled, try disabling it, or adjusting its configuration in each of your text formats (admin/config/content/formats).

like image 76
Andrew Schulman Avatar answered Jan 22 '26 20:01

Andrew Schulman


Have you checked if the $base_url variable in the 'sites/default/settings.php' file has the correct value? According to documentation "if Drupal is generating incorrect URLs on your site, which could * be in HTML headers (links to CSS and JS files) or visible links on pages * (such as in menus), uncomment the Base URL statement (remove the * leading hash sign) and fill in the absolute URL to your Drupal installation."

like image 30
geoandri Avatar answered Jan 22 '26 21:01

geoandri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!