daneth1712 Posted August 14, 2009 Share Posted August 14, 2009 Hi guys, I have quite a big problem here which I desperately need help with. I have a site that is currently working in .ASP and .ASPX running on an MSSQL server. We are changing everything over to MySQL and PHP, however... I have just realised that all our pages are indexed through google with the obvious .asp extention. how can I get WAMP to read a .asp file? as I need to create redirects from those pages to our new php pages. I have hunted high and low for a solution, I just hope the brilliant minds at phpfreaks have a solution. Thanks in advance for any help and assistance! Quote Link to comment https://forums.phpfreaks.com/topic/170274-wamp-reading-asp-files/ Share on other sites More sharing options...
wildteen88 Posted August 14, 2009 Share Posted August 14, 2009 You can use mod_rewrite to redirect all urls in ending .asp or .aspx to the corresponding .php file. Like so RewriteEngine On RewriteCond %{REQUEST_URI} !-f RewriteCond %{REQUEST_URI} !-d RewriteRule ^(.*).aspx?$ $1.php [R=301,QSA,L] As for porting your MSSQL databases to MySQL I'd keep to MSSQL. PHP is capable of using MSSQL databases However I do not recommend using WAMP as a production server. It is recommended to use it as a development server. Quote Link to comment https://forums.phpfreaks.com/topic/170274-wamp-reading-asp-files/#findComment-898229 Share on other sites More sharing options...
daneth1712 Posted August 14, 2009 Author Share Posted August 14, 2009 Hi wildteen88, thanks for your response! so in WAMP, I have enabled the apache module for rewite_mod, but where should I place that code? into the httpd.conf file? or do I have to do something to the mod_rewrite.so file? Please excuse the stupidity, i have never had to do this before. As for using WAMP, I have never had any luck with setting up php to work properly, so have always ended up using WAMP, would you suggest trying to install each component individually, or using something like XAMPP instead? As for MSSQL, unfortunately that is not up to me, bosses looking at cutting costs. Quote Link to comment https://forums.phpfreaks.com/topic/170274-wamp-reading-asp-files/#findComment-898304 Share on other sites More sharing options...
wildteen88 Posted August 14, 2009 Share Posted August 14, 2009 That code goes within a file called .htaccess (that is the full name). This file should be placed in your websites root folder (eg C:/wamp/www). For a production environment then I do not recommend any sort of all-in-one solution, such as WAMP, XAMPP etc. These should only be used for development/testing purposes only. For a production environment IMO you should setup Apache, PHP and MySQL separately. Quote Link to comment https://forums.phpfreaks.com/topic/170274-wamp-reading-asp-files/#findComment-898312 Share on other sites More sharing options...
daneth1712 Posted August 14, 2009 Author Share Posted August 14, 2009 Ok I created a file in the root and added that code to it, I also created a file of the same name as the asp file and tried to navigate to that page. The page is called register.asp, and I also have the new page at register.php. When I enter the address I get an error; 403 Forbidden error You don't have permission to access /C:/wamp/www/domain/register.php on this server This is on a windows server, so I shouldnt have to set any other folder/file rights? Quote Link to comment https://forums.phpfreaks.com/topic/170274-wamp-reading-asp-files/#findComment-898508 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.