Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect loop. #13

Closed
brianmcallister opened this issue Dec 7, 2012 · 14 comments
Closed

Redirect loop. #13

brianmcallister opened this issue Dec 7, 2012 · 14 comments

Comments

@brianmcallister
Copy link

Can't seem to work this one out. Here are the steps to reproduce:

  1. Clone this repo (with the --recursive flag)
  2. Create the local-config.php file, add in the db details.
  3. Visit the site.

That'll get me a redirect loop every time. Interestingly, I tried following the WordPress directory instructions, and that also resulted in a redirect loop.

Not sure if this is the correct place to post this issue, so let me know if it's a better fit for the WordPress bug tracker.

@markjaquith
Copy link
Owner

This is expected, in a code sense, but probably not in a user sense. Because WordPress is installed in /wp/, you have to go there and install WordPress there. Then, you update your Site URL option get_option('home') to remove the trailing /wp. Then it'll work from the root.

I'll leave this ticket open to think of a better way to handle this.

@brianmcallister
Copy link
Author

Ah, ok, that does actually make sense. I did suspect that the WP_SITEURL played a part in this, and I was trying to set it to WP_HOME . /wp/, but I understand now why you have to install at /wp/.

I've seen other tickets about an install script. Maybe having that script open a browser, or at the very least show a big notification about going, to the /wp/ url would be helpful.

@markjaquith
Copy link
Owner

Instead of re-inventing the wheel, I think I'll make an install script that uses WP-CLI to do the heavy lifting.

@conatus
Copy link

conatus commented Dec 27, 2012

I also got this endless loop problem. I can't really remember how I solved it though!

@conatus
Copy link

conatus commented Jan 2, 2013

Just in case anyone else gets stuck - change the site URL only using Settings > General in the WordPress interface. Everything then works. If you change both then it ain't gonna work!

Thanks a lot!

@getdave
Copy link

getdave commented Jan 3, 2013

I followed the steps above but when I altered the site name to remove the /wp/ in the Settings menu I can no longer access the /wp-admin/

@moimikey
Copy link

if you're using Apache, editing your .htaccess like so should do the trick:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) /wp/$2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ /wp/$2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress

and for multisite, also throw in:

RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

@hswolff
Copy link

hswolff commented Mar 17, 2013

I ran into this issue as well and managed to figure it out myself.

If anything else @markjaquith I would add a note about this to the root README file that a user must install WordPress from the wp directory and then change the Site URL after install is complete.

@conatus
Copy link

conatus commented Mar 18, 2013

Hey @hswolff - if you think this is an important issue, why not make a pull request to edit the readme to that effect? You can even do it in the browser.

@hswolff
Copy link

hswolff commented Mar 18, 2013

Pull request sent!

@AcireStudios
Copy link

I ran into some problems when trying to set this up with a local (MAMP) multisite install.

My install was working fine until the last network configuration steps. I got a warning because of the custom content directory potentially not working with a network install, but proceeded, hoping the WordPress-Skeleton/multisite issues had been worked out with the changes in 3.5+. I then made the configuration changes to wp-config and .htaccess, according to the WordPress instructions.

When trying to login after these changes, I get the redirect loop error. I'm not sure if this due to the custom content directory or some other multisite disagreeableness. Does anyone have any ideas on how to resolve the issue?

@shshaw
Copy link

shshaw commented Aug 30, 2013

I was confused by this too when running locally on MAMP. This should definitely be noted in the Readme or local-config-sample.php. Would love to see some clearer instructions, or possibly even a shell script to run to get everything set up.

@dutchiexl
Copy link

I removed /wp from Site Address (URL). Now none of my styles or JS files are loading anymore :(

@prochorz
Copy link

prochorz commented Jul 27, 2018

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');

I add this to wp-config. And its total fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants