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.
Related
I am trying to install Laravel 5.3 in sub domain /public_html/mysite
but it's not working should I change .htaccess or what ?
Put the content of public (L5) directly on public_html (be aware of don't overwrite the .htaccess file accidentally) Now in then modify your index.php and your bootstrap.php and it will work just fine
I hope #Nino Armani gave you the right answer. Although you can try with visual video tutorial here-
http://www.tisuchi.com/upload-laravel-projecy-cpanel/
Move everything from project/public folder to project/ folder
Update index.php to have bootstrap path like "./bootstrap"
Add base APP_URL in your .env
Update layout folder paths like {{URL::to('/css/app.css')}}
Co-Hosting on GoDaddy, have had a fully functioning WordPress site setup under the primary domain in a sub-folder renamed from "/wordpress/" to "/opportunities/" as in => "http: //howtoliveoffthegridnow.com]/opportunities/" Naturally, this works perfectly just as it should!
Following the WP directions for moving the "Site Address(URL) while leaving the "WordPress Address(URL) as above, I "copied" the ".htaccess" and "index.php" files from the "WordPress Address(URL) "/opportunities/" folder, as above, into the newly designated folder "shopping" so that the "Site Address(URL)" now becomes "http: //shopping.howtoliveoffthegridnow.com/" This works as it should and equally as well as the original setup above!
In the case of the folder housing the principle php based web content (not WP content) labeled "howtoliveoffthegridnow.com", this is located under our version of GoDaddy "public_html" home folder. our "/opportunities/" folder is a sub-folder located under "howtoliveoffthegridnow.com". Our new "shopping" folder is directly under the GoDaddy "public_html" home folder. The site DNS record has been updated to include an "A" hosting record for this "shopping" subdomain name.
The content of the ".htaccess" file now copied into the "Shopping" folder, per WP directions, is as follows:
`# BEGIN WordPress`
`# From wordpress itself after changing site address`
`<IfModule mod_rewrite.c>`
`RewriteEngine On`
`RewriteBase /`
`RewriteRule ^index\.php$ - [L]`
`RewriteCond %{REQUEST_FILENAME} !-f`
`RewriteCond %{REQUEST_FILENAME} !-d`
`RewriteRule . /index.php [L]'
`</IfModule>'
`# END WordPress`
The content of the "index.php" file now copied into the "Shopping" folder, per WP directions, is as follows:
`<?php'
`/**'
` * Front to the WordPress application. This file doesn't do`
` anything, but loads
` * wp-blog-header.php which does and tells WordPress to load the theme.`
` *`
` * #package WordPress`
` */`
`/**`
` * Tells WordPress to load the WordPress theme and output it.`
` *`
` * #var bool'
` */`
` // remove 'shopping' subdomain name from directory path`
`$dir_root = str_ireplace('/shopping', '', dirname(__FILE__)); `
`/wp-blog-header.php'." <br />";`
`define('WP_USE_THEMES', true);`
`/** Loads the WordPress Environment and Template */'
`//require( dirname( __FILE__ ) . '/howtoliveoffthegridnow.com/opportunities/wp-blog-header.php' );'
`require( $dir_root . '/howtoliveoffthegridnow.com/opportunities/wp-blog-header.php' );'
With these two files set in the "shopping" folder, the content of the original WordPress installation in "http: //howtoliveoffthegridnow.com/opportunities/" shows up perfectly under "http: //shopping.howtoliveoffthegridnow.com/" This also works perfectly just as it should.
However, when subsequently changing the sub-domain of the "Site Address(URL)" from "shopping" to "deals" with this new address by creating a new folder with the name "deals" under the same overall site public_html home folder off the same domain and server setup as described above for "shopping" and respectively for "/opportunities/" all per WP directions, copying the required ".htaccess" and "index.php" files into "deals", now when choosing "http: //deals.howtoliveoffthegridnow.com/" instead of "http: //shopping.howtoliveoffthegridnow.com/", the "deals" site shows only a page with nothing but the default "Coming Soon" motif/blank page instead of the WordPress content which shows up perfectly under either "shopping" or "/opportunities/" respectively when the "Site Address(URL)" data is accordingly respectively changed to suit the desired output URL.
The site DNS record has also been updated to include an "A" hosting record for this "deals" subdomain name.
Note also: The "index.php" file for the "deals" folder was edited to change:
` // remove 'shopping' subdomain name from directory path`
`$dir_root = str_ireplace('/shopping', '', dirname(__FILE__)); `
to:
` // remove 'deals' subdomain name from directory path`
`$dir_root = str_ireplace('/deals', '', dirname(__FILE__)); `
Any suggestions as to what is wrung :) here would be most gratefully received.
Note: gaps left between each "http:" and the "//.??restoftheurl.com" in the above are there simply to comply with the limit imposed restricting the number of links that can be included in a post and should be ignored if you choose to try following any of those links.
Insomuch as I could gather from your question, you are trying to move (migrate) the WordPress site from a sub-folder to a subdomain (and it is not working).
Here is how I would go about with this:
On your original/working (sub-folder based) site, install this plug-in:
https://wordpress.org/plugins/duplicator/
Next, generate a Duplicator package (via the plug-in's menu on wp-admin dashboad).
Once the package is generated, download the two package files (installer.php and the archive/zip file) to your PC. Next, upload these two files to the sub-domain (deals) folder where you wish to create the site. Next, open the following link in your browser:
http://deals.howtoliveoffthegridnow.com/installer.php
and follow on-screen instructions. Your site should get created and everything should work fine.
After further investigation, I am embarrassed to admit - but I do admit, that the problem seems have have occurred because apparently I inadvertently skipped over a critical step in creating "deals" as a sub-domain when adding it to my file structure in the GoDaddy cPanel options.
Instead of starting from the cPanel icon for creating a new sub domain, I went straight to the DSN records page and created the new record manually which bypassed the under-the-covers code that would connect the sub-domain folder into the web hierarchy correctly, thus although one could pull up the sub-domain by entering its URL in the browser, that result was effectively orphaned from its related primary domain.
Having retraced my steps and followed through in correctly adding this sub=domain, the problem has now been resolved.
The lesson here seems to be that we just cannot skip steps because that defeats us in the effort to reach our goal when the underlying systems are bypassed.
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' );
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]/
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