Forum Replies Created

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter creativepublishing

    (@creativepublishing)

    Redirecting in code?

    Hrmmmphff!

    Must be a header() location call. I haven’t dug through the code for WordPress much as I was just fiddling with it when I started this thread.

    I am very surprised that it redirects without the .htaccess file. Where is it redirecting to? Get a plugin for your browser and check out the headers of the server response. Something like Live Headers.

    That might help you debug the issue. Otherwise I have no idea without some more info πŸ™

    Thread Starter creativepublishing

    (@creativepublishing)

    Have to use the boilerplate for subdomain install if thats what your using. Subfolder wont work.

    Thread Starter creativepublishing

    (@creativepublishing)

    No, the folder does NOT exist. If the folder exists, if will give you a 404 and not work. The htaccess file checks if the folder or file its looking for exists. Only if it DOESNT exist, does it redirect to the proper file. Subdomain installs also use a different set of htaccess rules I believe so none of these in this thread should work.

    Thread Starter creativepublishing

    (@creativepublishing)

    If you are certain you tried the boilerplate code from the beginning of the post EXACTLY as it was listed, then I’m afraid I don’t know what to offer as guidance. I see two differences between the boilerplate and what you currently have:

    1. At the very bottom you have a couple lines that are designed to redirect the www to the non-www. That is not in the boilerplate.

    RewriteCond %{HTTP_HOST} ^aaa\-my\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.aaa\-my\.com$
    RewriteRule ^/?$ "http\:\/\/aaa\.my" [R=301,L]

    2. You also have some variable references on these lines:

    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]

    Whereas the boilerplate has:

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]

    I would try these:
    1. This is just the same boilerplate as above – please try this one more time for me, exactly as this with no additions or deletions.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    2. This is without the www/non-www code:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    3. This one is the boilerplate minus the variable change.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    RewriteCond %{HTTP_HOST} ^aaa\-my\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.aaa\-my\.com$
    RewriteRule ^/?$ "http\:\/\/aaa\.my" [R=301,L]

    I should note that I don’t like the look of the www/non-www redirect, something deson’t look right to me about it. You should goto stackoverflow.com and search for “htaccess www to non-www redirect” there are a wealth of posts on this issue and make sure it is done correctly. Also, in the direction when installing the multi-site, there is a usggestion to take care of that feature in the options BEFORE installing the multisite code. Just something I noticed.

    Additional questions:
    Is your wordpress install at root? or in a sub-folder? i.e. aaa.com/wordpress/ ?

    The problems your describing are exactly the problems I described, so it should be a similar issue. Is this a fresh install, where you can start from scratch? or an existing blog?

    Thread Starter creativepublishing

    (@creativepublishing)

    It sounds to me like the issue has to do with your initial install into the /wordpress folder. This probably won’t work, but try changing the second line to:
    RewriteBase /wordpress/
    OR this:
    RewriteBase /

    All I did was add a slash after the folder name. The second one might work if the htaccess file in in “/wordpress”. You should only need to rewrite base to say “/wordpress/” IF the htaccess is at “/” and the wordpress install is at “/wordpress/”. If BOTH the htaccess file and install are at “/wordpress/”, I don’t believe you would need it.

    A few questions.
    What folder is the htaccess file in? Is it in the root folder “/” or is it in the wordpress folder “/wordpress” ?

    Have you tried the boiler plate code I listed above EXACTLY as it is? Without changing the rewrite base?

    Good luck.

    Thread Starter creativepublishing

    (@creativepublishing)

    To everyone:

    I am so happy I was able to help you guys. Best of luck in your ventures πŸ™‚

    Thread Starter creativepublishing

    (@creativepublishing)

    Your welcome πŸ™‚ No idea, I am a WordPress “noob” lol.

    Thread Starter creativepublishing

    (@creativepublishing)

    Okay,

    An Htaccess file should only have one “RewriteEngine On” This essentially turns of Apache’s ModRewrite.

    What you did is add the boilerplate instead of replacing the old code with the new code. You essentially have two htaccess files in once there. Make a backup and then delete the line between #BEGIN WordPress and #END WordPress – then let me know how it goes for you.

    Thread Starter creativepublishing

    (@creativepublishing)

    The htaccess file is in the root directory of your wordpress install. It is a hidden system file “.htaccess” so you might not be able to see in the dashboard. You might need to use an ftp program such as WinSCP.

    drrota your problem is this.

    If you look in your htaccess file it has the lines:

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d

    These mean that in order to rewrite the code, there file and directory cannot exist. This keeps the rule from redirecting files in other folders that DO exist.

    The problem? If a directory DOES exist, then it doesn’t get rewritten. In a subfolder multisite install, the folders that display in the address bar DON’T actually exist. They are imaginary. Your htaccess file checks if the folder exists, finds out is does, and sends you there.

    The solution?
    Delete the folders you made with mkdir. If the server check for the folder, find out it doesn’t exist, then it will redirect to the core wordpress install and work for you. Hope this helps πŸ™‚

    this sounds like a wonderful question for stackoverflow. This is a bit of a complicated htaccess rule and there are a lot of great programmer over at the stack.

    Thread Starter creativepublishing

    (@creativepublishing)

    Your welcome Alex, glad I could help πŸ™‚

    Maybe its time to get like a sticky or something on this post? If this many people have bothered to post AFTER fixing the issue, how many have used it to fix their installation? Might help with some of the repeated questions on this specific forum about this issue……

    Thread Starter creativepublishing

    (@creativepublishing)

    Sorry πŸ™ don’t work with IIS.

    If it is the same issue, you should only have to find the spot where the absolute path for the server is and take it out.

    Sorry πŸ™

    Thread Starter creativepublishing

    (@creativepublishing)

    Glad I could help, now get working on your new uber multisite πŸ™‚

    Thread Starter creativepublishing

    (@creativepublishing)

    Thank you very much for the response Mika,

    I have done a fair deal of reading the forum recently and have noticed that you put a lot of time in here helping people. I just wanted to say that I for one appreciate your time.

    Turns out I didn’t have to change any Cname or A records at all, as all of my domains are on the same host, I simply directed the secondary domain at the proper folder and walla. Of coarse, they share an IP address, but short of getting dedicated IP addresses – I don’t see how that is A. Any different than the way they were setup, and B. an issue, as hundreds of domains run the same IP at a shared host.

    Thanks again πŸ™‚

Viewing 15 replies - 1 through 15 (of 20 total)