Dymanic Links in PhP not working after site migration
I have recently migrated a custom CMS to a new server and for the life of me I cannot work out why the links are no longer working.
I have looked into some rewrite rules, which at the very most retained the same home page no matter which menu item was selected so I figured it was just a matter of doing the correct configuration.
Unfortunately there was no original .htaccess document from the original host server for me to check the configuration, and the site doesn't seem to even need one to run correctly so now I am at my wits end - an开发者_如何学JAVAy help would be greatly appreciated!
Here is some sample code from one of the menu items:
<div class="menu-membership<?=(($p)=="membership" ? "n" : "") ?>"><?=(($p)!="membership" ? "<a href=\"/membership/\"><img src=\"/images/menu/m-membership-grey.gif\" /></a>" : "<img src=\"/images/menu/m-membership-red.gif\" />") ?>
<?php if(($p)=="membership") { ?><ul class="submenu">
<li><a href="/membership/how-to-join/">How to Join</a></li>
<li><a href="/membership/faq/">FAQ</a></li>
<li><a href="/application/">Apply Now</a></li></ul>
<?php } ?>
</div>
Readable version:
<div class="menu-membership<?php echo $p == "membership" ? "n" : ""; ?>">
<?php if ($p != "membership") : ?>
<a href="/membership/"><img src="/images/menu/m-membership-grey.gif" /></a>
<?php else : ?>
<img src="/images/menu/m-membership-red.gif" />
<?php endif; ?>
<?php if ($p == "membership") : ?>
<ul class="submenu">
<li><a href="/membership/how-to-join/">How to Join</a></li>
<li><a href="/membership/faq/">FAQ</a></li>
<li><a href="/application/">Apply Now</a></li>
</ul>
<?php endif; ?>
</div>
So it looks like there isn't actually a /membership/index.php file, you were just using a "clean url" rewrite method to change urls like /index.php?n=membership into a "flat" url style?
also, did your old server host multiple sites? If so your apache rewrite rules are probably be in the vhosts file not httpd.conf. That or there are .htaccess files and you arent seeing them because Mac hides all files starting with .(dot) which you can view by changing Finder settings using the terminal (but you still cant see them through FTP when looking at your Mac remote server)
Also what is the destination url or output message for ErrorDocument 404?
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request
means you've got a custom error document page or message that isnt working correctly
精彩评论