Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/170274-wamp-reading-asp-files/
Share on other sites

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.

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. :shrug:

 

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. ;)

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.

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?

 

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.