Magento folder change - php

I tried to rename the Magento installed folder but it not load properly. Before It store in "demo" folder. At that time it was loaded nicely. I renamed the folder name from that time it shows only text while browsing the website. I have already changed the permission of "var" and "media" folder.
How can I make the website visible with templates.

change the base url from backend or from database in core_config_data table
rename it with your renamed folder.
if you change root folder name than this must be updated manually than only all things will work correctly.

change base url in core_config_data table
and don't forgot to add "/" at the end.
to load site properly with stylesheet
for example: localhost/[your_newfolder_name]/
or
http://[websitename]/[yourfolder]/

Related

How to chnage the uploads directory path in wordpress

I have used
define( 'UPLOADS', 'wp-content/'.'files' );
but it is only chnage the path witin wordpress folder.
I need to setup My uploads folder outsite the my C drive. I have setup the server configuration but unable to set the path in wordpress
my current path uploads directory is
C:/xampp/wordpress/wp-content/uploads
but the path is needed that
D:/images/uploads
Change Default Media Folder
Open your wp-config.php file, locoed at the root of your WordPress installation, and add the following snippet:
define('UPLOADS', 'wp-content/myimages')
Make sure you add this code before the line:
require_once(ABSPATH.’wp-settings.php’);
If the directory doesn’t already exist, WordPress will automatically create it as long as the wp-content folder is writeable. Otherwise you can great the folder yourself via FTP, cPanel etc.
You can also change the way uploads are organized. If you open your uploads folder you’ll notice that files, by default, are sorted into years. You can change your file organization so that all media files are dumped in the one folder. Go to Settings > Media and uncheck “Organize my uploads into month- and year-based folders.”
Not only will it make your URLs simpler, it will also make it easier to see all your files in one place instead of having to sort through month and year directories.

Upload folder of Wordpress outside the project

I am trying to define the wordpress upload folder outside the installation directory. My directory structure is:
/path/to/my/base/folder
|-> wordpress (the wordpress installation)
|-> uploads (the required upload folder)
I have tried defining the 'UPLOADS' in my wp-config.php like:
define('UPLOADS', '../uploads');
Wordpress creates the folder and the images are uploaded there, but cannot use it when required. The image URL looks like :
www.myhost.dev/../uploads/image-file-name-format.jpg
But if I use absolute path to define the 'UPLOADS' like
define('UPLOADS', '/path/to/my/base/folder/uploads');
this works.
But the problem is, then the image url looks something like:
www.myhost.dev//path/to/my/base/folder/uploads/image-file-name-format.jpg
This tells the location of the file and this can be a security issue.
So, is there a better way to define the relative path for the uploads folder which will point to my required folder?
Thanks in advance.
I have done it at last by making a symlink with proper permissions. In my case, when I tried to make a symlink, the symlink did not have enough permission to write into the folder. This was because of my system (I am using Macbook). So what I did is:
$ cd wp-content
$ mv uploads /path/to/my/base/folder/
$ ln -s ../../uploads uploads
$ chmod -h 777 uploads
Check the last line where I have changed the permission for the symlink. Normally in most of the cases, you don't need to change the permission of the symlink, as they inherit the permission of the folder.
A couple of notes that may help people:
define( 'UPLOADS' , 'blah') is typically RELATIVE to the WordPress core root directory. The default is 'wp-content/uploads'. If you try to put the uploads outside of the WordPress directory with something like '../uploads/' as the define the upload URL will typically not work causing problems.
If you set the path with the define() inside your wp-config.php WordPress will NOT read the upload_path setting, if you have used it.
I found that setting the upload_path option in WordPress is better for storing media files outside the WordPress install path. Login to your WP Admin and go to the url /wp-admin/options.php to see the "raw" options list for WordPress.
Look for the upload_path setting. Put in your FULL PATH on the server like /usr/wpsite/uploads/ where /usr/wpsite/public_html would be where your WordPress core install typically ends up. Save the settings.
Your uploads will now be placed OUTSIDE the WordPress install directory. Make sure the web server has read/write permissions to the directory.
Also note that WordPress will put ALL FILES in that directory. It will not separate them into year/month subfolders as is the default for a typical WordPress install. If someone knows how to retain that feature please comment.
If you take a look at this link http://www.wpbeginner.com/wp-tutorials/how-to-change-the-default-media-upload-location-in-wordpress-3-5/
You need to use a path like so
define( 'UPLOADS', ''.'uploads' );

Deleting "wordpress" from URL

I just launched my first WordPress blog, and I went into Settings > Permalinks to make the links look like this:
mysite.com/wordpress/a-fun-day
I just wondered if there's a way to either delete "wordpress" from the URL, so it looks like this...
mysite.com/a-fun-day
...or replace "wordpress" with a category, like this:
mysite.com/events/a-fun-day
mysite.com/world/japan
I guess you uploaded all "Wordpress" folder to your Public_html. That's reason you always get /wordpress/ in your links !
Now How to delete "wordpress" from the URL ? Please try:
step 1: Goto your folder "Public_html/Wordpress/"
step 2: Select all files and folders, Copy all to "Public_html" folder
step 3: Goto your wordpress admin panel and Goto config option
step 4: Change link live site to your domain (if it display wrong).
If you still have errors, you can Install wordpress again but you need upload all files and folders inside "wordpress" folder to "public_html"
If you have access to your apache configuration, you can change your document root to include /wordpress, and change your Wordpress site to exclude /wordpress.

How can i change Ornagehrm theme

I installed Orangehrm System from OrnageHRM
There are two directories called themes
/symfony/web/themes
/themes
How i can change theme of system ?
If you want to change theme of OrangeHRMS than you should change in following path of themes folder
/symfony/web/webres_554af33274f2b9.68269152/themes
Here you will get two folder inside themes
1. default
2. smackgreen
Now you need to go in default folder and you will get css folder in this and there is also main.css
You need change in main.css file for change theme of OrangeHRMS.
I Hope your problem will solve.

put config in secure place, can not link the files

Am trying to use a config file for a database and rating script but the problem is the config file is in this directory :
website.com/include/config.php aka websitename/include/config.php
The rating script needs the config and is accessed like this:
include_once("config.php");
I want the config to be in:
"/files/website/"
A directory level up from the website root folder.
I have been trying with:
"../files/website/" and other variations but can not figure out how to link them.
I have managed to put one config file and access it, but with this ajax rating script the only way for it to work is to have the config in the /include/ folder next to:
rating_process.php - has this link : include("inc/config.php");
rating_functions.php - has this link : include_once("config.php");
rating_total_functions.php - has this link : include("inc/config.php");
Hope i've explained myself here
Right, looking at my hosting now:
$_SERVER['DOCUMENT_ROOT']; outputs this: /foldy/homepages/11/username/htdocs/webbysite
My index file is located at: /foldy/homepages/11/username/htdocs/webbysite/index.php
The included rating script is located in: /foldy/homepages/11/username/htdocs/webbysite/include/
I want the config to be in /foldy/homepages/11/username/htdocs/secretfiles/config.php
Am trying to some how go out of: webbysite folder and then into secretfiles (sibling folders)
I have tried adding ../ and so on, but am missing something obviously :(
Try
$configLocation = $_SERVER['DOCUMENT_ROOT'].'../files/website/config.php';
include_once($configLocation)
but the problem is the config file is in this directory
it is not a problem at all.
just keep it as is.
Concerning your particular problem, your problem is that you don't know where you want to put your file. /files/website/ is not likely a right path and it is apparently not one level high from webroot.
So, first of all make your mind about the right path to the directory and it's relative position to the web root
if you are concerned about security ( because your config file contains the db details ) i would place the db config file outside the site root folder and then require_once('../../dbConfig.php') from the script that's creating xml or json for your ajax
more exactly ...
your site folder might be here: /var/www/html
set a virtual host (done differently on Linux and Windows) and point your domain to a sub folder inside /html so that the new path to the site root is /var/www/html/site.
then place your config file in /var/www/html and call it from your scripts inside your /site folder using require_once('../dbConfig.php)`.
your db details are outside the site folder

Categories