After moving website to my local dev machine, relative links stopped working. When i click button with relative link /login, for example, browser redirects to
https://localhost/login/
and shows
Code: Not Found
The requested URL /index.php was not found on this server.
While it should have redirected to https://localhost/сс/login/
.htaccess contents on localhost:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cc/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cc/index.php [L]
</IfModule>
Website files are in var/lib/html/cc folder.
SiteURL and HomeUrl
are both equal to http://localhost/сс
Parmalinks setting http://localhost/cc/sample-post/ is used, so no problem with navigating to pages.
How to fix this issue?
Tried different .htaccess modifications, moving index.php to /var/lib
Nothing helps.
just use WP Migrate DB plugin for database export , it will change all link to your desire link and use this database export file in live site
Link ( https://wordpress.org/plugins/wp-migrate-db/)
Related
I have installed wordpress in main domain (fewinfo.com) and its running successfully. now, i have installed wordpress in subfolder (fewinfo.com/wp) but when i check post inner page it shows 404 error.
I have updated .htaccess using below code but not working and also I have tried without "wp" that also not working.
NOTE : Website have hosted in Godaddy
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress
Go to Settings » Permalinks, and simply click on Save Changes button.
You can replace or export data using Wp Migrate DB.
Easy to replace any url in your current database without lose any data or serialization issue.
Changing the Site URL multiple ways.
After Change Url Update:
Go to
Settings » Permalinks
Update permalink.
I am trying to copy down my web app from the internet to localhost on my machine for further development. The URL of my project is www.uniformlab.net. I am new to wordpress and this site is the biggest one that I have tried to copy.
I am using MAMP as my local server and have set up all the correct variables in getting the database set up. Some resources are loading and many are not, with a large download time.
This is a list of errors that are being thrown on runtime of the website. I don't think that these resources are being called from an absolute path.
I have set the home and siteurl settings in the DB to locahost:80/UNIFORMLAB
When I change the url to localhost/uniformlab/wp-admin, I am getting thrown ERR_TOO_MANY_REDIRECTS by the browser.
I have checked my htaccess file and it seems normal. This is what I have:
# BEGIN WordPress
<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
Any help would be appreciated.
There is not too much info, but one thing is that the home and siteurl in WordPress have to be the full path to the WordPress directory.
You said that your URL is http://localhost/uniformlab but you changed the setting to localhost
Update again the home and siteurl to http://localhost/uniformlab
I'm sorry about my tittle. I'm not sure how I can categorize this question.Please do edit if necessary-Thanks
Here is the issue I'm having:
http://domain.com is my main server- in this main server I'm listing all of the downloadable files I have from another server which is http://myfilehost.com.
on http://domain.com I list my files like so:
download myfile document
download all myfile
The first link is working perfectly fine but when it comes to the zip file I always get the ff error which is really weird:
Here is the htaccess of http://myfilehost.com which I think is the default of wp as its also a wp website not sure if this is hosted on hostgator/bluehost:
# BEGIN WordPress
<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
And o I think this is also worth mentioning:
When I try to go to http://myfilehost.com first and wait for it to load then add the directory /downloads/myfile.zip to the URL its actually working perfectly and downloading myfile.zip..
Thank you Everyone for your kindness of helping me and giving me a response
I apologise if this has been asked, I was unable to find clear information anywhere on it.
We've recently been forced into moving to a VPS hosting package.
Thewre were a few issues with links that I managed to fix but now the issue lies with the home page. Every page apart from the home page works as should and at the correct address. I.e. website.co.uk/contact instead of /blog/contact.
I assume this has either something to do with the .htaccess file and/or mod rewrite being disabled on the new server.
Most solutions I`ve found all relate to the homepage working and the other pages not. I'm having basically the opposite of this problem.
See http://www.crowdwifi.co.uk it redirects to the /blog/ and creates the 404 Error within Wordpress. You can see from there the other pages and permalinks are fine.
Im on tablet at the moment but can post htaccess code for the root in here in an hour if it helps. I contacted host support but theyve been rather slow so I figure it may be easier for me to try and resolve it.
Added the .htaccess from the "/blog/" subdirectory below.
# BEGIN WordPress
<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
Have you checked your Front page settings are not pointing to a specific page?
Dashboard => Settings => Reading => A static page (select below) => Front page
Have you also checked your General Settings do not have the wrong URL?
Dashboard => Settings => General => WordPress Address (URL)
Dashboard => Settings => General => Site Address (URL)
Can you post up a copy of your .htaccess file?
EDIT:
Set both WordPress Address (URL) and Site Address (URL) to http://www.crowdwifi.co.uk if that doesn't work then try changing your htaccess to this as well:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
I am changing my permalink structure in wordpress admin panel,
after changing this, when I click on post its throwing Internal server error
if changing it to default permalink structure , its working fine.
changing permalink setting in my localhost is working fine , but in staging server its throwing internal errors, I checked my .htaccess file in staging server , new rules are getting updated , but its showing internal error issue which is not coming in localserver.
I am using Wpengine webhost .
and I am in staging server mode.
How can I get rid of this problem
Talk to your webhost; your changes are not being written to .htaccess or your webhost doesn't allow .htaccess and mod_rewrite to be used.
See http://codex.wordpress.org/Using_Permalinks
If you're on a Windows server, see http://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite
You trying to rewrite the url two times:
.htaccess file
WP Permalink settings
Get rid of your .htaccess file
(or comment first line)
<IfModule mod_rewrite.c>
# RewriteEngine On
RewriteBase ./
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ./index.php [L]
</IfModule>
hope this will help.
If you installed wordpress in a subdirectory you need to change the line
RewriteRule . /index.php [L] (last line before /IfModule) with RewriteRule . subdirectoryName/index.php [L]
Change subdirectoryName with the name of the subdirectory that wordpress is installed.