.HTACCESS - Dump site from production to development - php

We recently have adquired the credentials to fully play with our website hosted outside.
So we need to mount it locally on a XAMPP stack to fully deploy the site and asociated database.
It've been already done, and everything seems to work properly except for the images in the site.
It is a DRUPAL site. Some images are "full path coded", so they work as we can expect, but major of them are just relative path coded.
Now, I've everything mounted on localhost. Let's say the folder with the site it's called "web".
Then i've everything on:
c:/xampp/htdocs/web/.......
So I access to it via: http://localhost/web/
I've tested that all the non viewing images, if I append the "http://localhost/web/" on the 'src="/site/..."' they are accessible and look right.
So, is there a way to via .htaccess add the "http://localhost/web/" on those URLs who hasn't it? It doesn't only happens with images, it's just related with all the links, urls, srcs, whatever which is just "relative pathed".
I've already tried the "RewriteBase /web", but it doesn't work.
Need help to solve this so, please.
In summarize, the site online is just mounted on the root, so everything works, fully or just relativetly pathed. But in my case, I've got the development site inside a folder, so I need it to work too!
Much appreciated.

If this is a Drupal 7 site (might work for Drupal 6) make sure you have a tmp directory set. Go to admin/config/media/file-system and look for the temporary directory. Also confirm that you have this directory on your root, which for XAMPP is the htdocs folder.
This might be a file permission that can be caused by incorrect .htaccess settings (This link may help: https://www.drupal.org/node/2140629) in the folder set as your temporary directory.
This may also be a document root error. You can change that by editing the DocumentRoot setting in C:\xampp\apache\conf\httpd.conf.
This stackoverflow link may help if none of the above suggestions bear fruit: https://drupal.stackexchange.com/questions/30113/configuring-the-temporary-directory

Related

adjustI can't access a folder from my xammp server

I downloaded a CRM application based on PHP. I want to try it on my XAMMP Server. I install it. But I can not login because of 404 error.
Then I rename index.php file, and
Then I noticed that an entire folder never appeared on my webpage. Normally, There are a "application" folder. But it is missing.That is appearence of my Chrome page
just a note : I activate mod_rewrite
Please Help me
This problem is valid for me. And I cant take a good answer. But, you vote down, and I cant ask question. Bravo!
Make sure the Apache-server (XAMP) user have permissions to access the directory. Also, make sure that your redirect mentioned points to a place that exist.

Local xampp wordpress installation - cannot find wp-blog-header.php

I'm working locally with XAMPP and Wordpress and I'm struggling with what is probably a very basic config issue. I'm not a professional IT guy, just a hobbyist hacker so I apologise in advance if I'm being a bit dumb but hopefully somebody can kindly offer some assistance here.
I've installed xampp locally on my iMac. I've then installed wordpress using the xampp wordpress installation package. Both seem to be working fine. To test the web server I created a simple .php test file and this generated the expected output when I entered "localhost/hello.php" into my browser. As far as wordpress is concerned entering "localhost/wordpress" gives me access the local wp interface to create and edit posts, change display settings etc etc. So far so good...
Now I want to create a new .php file that includes the instruction:
require('XXX/wp-blog-header.php')
where the "XXX" is obviously the relevant directory path for the wp header file.
I cannot find this file, or indeed local wordpress files, anywhere (and I've searched extensively). In the "home" location for "localhost" (which I know from my "hello.php" test) there isn't even a wordpress directory so I'm totally puzzled as to how typing "localhost/wordpress" in my browser is accessing the local wp installation or how to go about determining the correct directory path for the wp header file I'm looking for?
I do understand that with this stack a great deal of info will either be generated on the fly, or stored in the local mysql database as opposed to the file structure, but I thought I would find some reference or alias somewhere to help me trace this through and determine what path to include in my .php file for wp-blog-header.php.
I've searched this forum and while there are several related questions I haven't found anything that helps me with this particular issue.
Thanks vm,
Ian
The location of your Wordpress files is:
/Applications/XAMPP/xamppfiles/apps/wordpress
Ok I found the path I needed and (partially) understand why I couldn't locate it. As Scriptonomy helped me identify the Wordpress files are held at:
/Applications/XAMPP/xamppfiles/apps/wordpress
While my test.php file is held at:
/Applications/XAMPP/xamppfiles/htdocs/test.php
The reason I couldn't locate either wp-blog-header.php or wp-load.php is because these there is an another "htdocs" sub-dir under the wordpress install location i.e.:
../apps/wordpress/htdocs
However I (as user "admin") don't have access to read this directory and so couldn't see the contents and therefore couldn't find the files. The permissions on the directory belong to "daemon" which I guess was the XAMPP installer package? Setting the directory path in my test.php file to:
../apps/wordpress/htdocs/wp-load.php
somehow the web server (?) can read the file (even though I can't see it myself via the Finder application) and so the code is now giving the expected result.
So problem solved even if I don't quite understand the solution!
Thanks for replies which helped me eventually get to a solution!
Cheers,
Ian

Installing Silverstripe 3.1 on subdomain

First time asking a question here but I'm really stuck.
Basically I'm trying to install a Silverstripe 3.1 cms on a subdomain as a development site, on my main domain I already have a Silverstripe 2.4 site running.
The first thing that comes up is this error, "development" is the subdomain folder.
Warning: require_once(framework/dev/install/DatabaseConfigurationHelper.php): failed to open stream: No such file or directory in /home/usr/public_html/subdomain/framework/dev/install/install.php5 on line 39
I check if the file is there and it is, then I check if the filepath is wrong because the file that is calling require_once has a full path from home/ but that can't be it because I've been able to install Silverstripe on my localhost.
I google redirecting (I've had no experience with it before) and find stuff on htaccess related to Silverstripe but none were problems that I was having, i.e. there are .htaccess files in main directory and subdomain. Not too sure if they're conflicting but I have tried RewriteEngine Off on my subdomain. I mostly leave the default Silverstripe .htaccess files as they are.
Even declaring different suPHP_ConfigPath's i.e.
main website: home/usr/public_html/
subdomain: home/usr/public_html/subdomain
At this point I look back at the error and try hacking the require_once filepath, changing it to
$_SERVER["DOCUMENT_ROOT"] . '/framework/dev/install/DatabaseConfigurationHelper.php
It mostly works but the requirements check page is void of css and any fails to GET any images
I am able to check all the requirements though passing everything but the File Permissions check:
"Does the webserver know where files are stored?" failed. Showing me the filepath it tried being the absolute path of a file prepended with the path to the subdomain. Looking at the code my hack was never intended to work.
Did I miss something? I'm not very knowledgeable with servers but I've done everything I can think of, is there anything I can do?
Hey thanks for your suggestion but I think it was meant for addon domains? I only wanted a subdomain for testing purposes.
What I ended up doing was to avoid installing Silverstripe on the server and instead install it on my laptop and then upload that to the server. It worked fine after copying the appropriate database and fixing Silverstripe's BaseURL to '/'

Drupal move from subdirectory

I had a drupal site completely working at www.example.com/example. I copied the files to the root folder in attempt to simply have the site held at www.example.com yet now it is asking for a new install and I have no idea why, I expected to have to make some changes, but not to be confronted with the request of a new install. I have heard it may be something to do with changing the base url but I'm not sure. Can someone please help me?
Thanks heaps
Assuming your site is on a linux based hosting, most probably your problem is divided into two parts
Problem 1) The settings file "sites/default/settings.php" is read only so when you moved the site to another directory it most probably didn't move this file because it is read only, and that was pointed out by another person
Problem 2) The second problem may be the result of enabling clean urls and not moving .htaccess file; when you moved the site to another directory you may have left out the ".htaccess". Check to see if it is moved to the new directory.
Another possibility is that you have a modified .htaccess to make the subdirectory work, in that case you may want to get a fresh ".htaccess" file from here :
http://code.google.com/p/drupalgooglecode/source/browse/trunk/.htaccess

Redirect Loop on Drupal 6 after moving website

I posted a question earlier today asking which files needed to be changed to move drupal to MAMP successfully.
I've now moved it all over and connected it to the database, however, I'm stuck in a redirect loop whilst trying to view the website. As far as I can gather, the redirect loop is stuck between index.php and install.php
How do I fix this? What would cause a redirect loop?
I read somewhere that there was a redirect file in a tmp directory and removing it will solve the issue, but for me the file doesn't exist.
Check if your web server has read permissions for settings.php.
Also check if the database is set up properly. As always, drush is your friend.
Sounds like an .htaccess issue, this happens sometimes when you're moving the site from a root path (ie. example.com/) to a subfolder (ie. localhost:8888/drupal/).
Try changing the RewriteBase in the .htaccess file to:
RewriteBase /drupal/
Where drupal is the name of the subfolder Drupal is installed in.
Due to my own in-experience with Drupal, I failed to recognise that the site in question was a Drupal Multi-site. The sites folder contained 'all' and 'example.com' There was no 'default' folder.
There was two solutions to my issue.
Set up MAMP as a Virtual Host (so example.com would direct to my mamp installation and so tick all the boxes for the files redirection)
Change the folder name to 'localhost' and not 'example.com'
The second solution did leave me with one or two issues, but as I'm only needing this installation for the theme I decided a botched solution would be least time consuming.

Categories