Jump to content

Recommended Posts

I have SEO Urls on my site and when trying to use any ajax such as below or dynamic dropdowns etc

 

w3schools.com/PHP/php_ajax_database.asp

 

They all work fine when i use the script on the page www.example.com/page

 

but when a trailing slash is added  www.example.com/page/

 

Any ajax script is calling in another copy of the entire page, not just what is contained in the external php file like it does without the slash

 

Does anyone know why this is happening?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/126729-solved-ajax-seo-url-problem/
Share on other sites

this most likely has to do with your url rewrite. the www.example.com/page makes a call to page.php  and with the slash it doesnt make a call to the right page.

 

what kind of webserver do you use is it IIS or Apache?

if the file litterly is called page then its different you are not using a url rewrite at all.

www.example.com/page

calls the page and parses the php code inside that file

 

www.example.com/page/

this will look in the directory called page instead of parsing the page file(which prob leads to an error)

what you could do is url rewrite

www.example.com/page/ so it opens the file

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.