Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I just moved a website from a hosted web server to MAMP and I am getting a strange error.

When I visit the homepage I get the default "It works" apache message. the url should be test:8888 but the homepage is being converted to just test

To make matters worse all other pages are working EXCEPT ONE. This page is also being converted to test/my-page when it should be test:8888/my-page.

ALL OTHER PAGES ARE WORKING CORRECTLY

Any ideas why this could be happening? I have changed the siteurl and home options in the wp_options table to http://test:8888 and as I mentioned everything is working correctly except for these two pages.

Thanks for the help.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The :8888 is the port your local Apache server is listening on and isn't actually part of the url.

To use your own custom domain name locally open up your host file sudo nano /etc/hosts

and add this line to the bottom

127.0.0.1 custom-domain.dev

Then add your domain to wp-config.php:

define( 'WP_HOME', 'http://custom-domain.dev' );  
define( 'WP_SITEURL', 'http://custom-domain.dev' );

Then you need to point the domain name in your Apache vhost to where your root directory is stored and change the port to 80. (You can do this using OSX's built in Apache / PHP. WPCandy has a good detailed tutorial on how.

Your Vhost should look like this:

NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#


<VirtualHost *:80>
DocumentRoot "/Users/your-name/Sites/blah"
ServerName custom-domain.dev
</VirtualHost>
share|improve this answer
    
oddly enough MAMP uses port 8888 and switching to port 80 solves this issue. –  Mike Oct 28 '11 at 0:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.