elgoog Posted October 2, 2008 Share Posted October 2, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/126729-solved-ajax-seo-url-problem/ Share on other sites More sharing options...
RichardRotterdam Posted October 2, 2008 Share Posted October 2, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/126729-solved-ajax-seo-url-problem/#findComment-655486 Share on other sites More sharing options...
elgoog Posted October 2, 2008 Author Share Posted October 2, 2008 Is Apache (WAMP Server). Also appears to be doing same on hosted server The page is not page.php it is called page and forcetype used to make it parse as php Quote Link to comment https://forums.phpfreaks.com/topic/126729-solved-ajax-seo-url-problem/#findComment-655491 Share on other sites More sharing options...
elgoog Posted October 2, 2008 Author Share Posted October 2, 2008 ss Quote Link to comment https://forums.phpfreaks.com/topic/126729-solved-ajax-seo-url-problem/#findComment-655503 Share on other sites More sharing options...
RichardRotterdam Posted October 2, 2008 Share Posted October 2, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/126729-solved-ajax-seo-url-problem/#findComment-655789 Share on other sites More sharing options...
elgoog Posted October 3, 2008 Author Share Posted October 3, 2008 Thanks Dj Kat Instead of trying to call the external file with external.php i called it using the whole path www.example.com/page/external.php Seems like it was looking for the file in the page/ directory and not the root. Problem Solved Quote Link to comment https://forums.phpfreaks.com/topic/126729-solved-ajax-seo-url-problem/#findComment-656026 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.