简体   繁体   English

更改永久链接结构后wordpress网站出现问题

[英]problems with wordpress site after changing permalink structure

My wordpress site lies in a folder called /entwurf/cob1 and since I wanted it to be shown by simply typing in www.cob1.org I changed the permalink to cob1.org and now nothing works. 我的wordpress网站位于一个名为/entwurf/cob1的文件夹中,由于我希望只通过输入www.cob1.org来显示它,所以将永久链接更改为cob1.org ,现在没有任何作用。 I tried changing the htacces to: 我尝试将htacces更改为:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /entwurf/cob1/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /entwurf/cob1/index.php [L]
</IfModule>

but this doesnt seem to work either. 但这似乎也不起作用。 I want my files who lie in the entwurf/cob1/ folder to be shown when typing in the cob1.org website. 我希望输入cob1.org网站时显示位于entwurf/cob1/文件夹中的文件。 Currently nothing is seen. 目前什么也没看到。

  1. Delete .htaccess , log into your wordpress, and let wordpress to generate .htaccess for you. 删除.htaccess ,登录到您的wordpress,然后让wordpress为您生成.htaccess ( Options -> Permanent Links -> Save) (选项->永久链接->保存)
  2. Check is it working? 检查是否正常? No? 没有?

  3. Upload to your web site root phpinfo file (php file with a content of " <?php phpinfo() ?> "), run it via browser. 上传到您的网站根phpinfo文件(内容为“ <?php phpinfo() ?> ”的php文件),然后通过浏览器运行它。

  4. Check what Server API cell says -> Apache? 检查什么服务器API单元显示-> Apache? If yes Check is there mod_rewrite enabled? 如果是,请检查是否启用了mod_rewrite No? 没有? Ask Support to enable it. 请求支持以启用它。

If its not a Apache, ask for a help of the person who setup your server. 如果不是Apache,请寻求服务器设置人员的帮助。

If you have access to the Worpdress admin panel go to Setting > General and make sure the Wordpress URL and Site URL are correct. 如果您有权访问Worpdress管理面板,请转至设置>常规,并确保Wordpress URL和站点URL正确。 They should be your new address. 他们应该是您的新地址。 Change those and save it if you want to rewrite all the old URLS in the database. 如果要重写数据库中所有旧的URL,请更改并保存。

If you don't have access to the WP admin panel try using this to manually make the changes to your database. 如果您无权访问WP管理面板,请尝试使用此面板手动对数据库进行更改。

https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Delete .htaccess and regenerate it. 删除.htaccess并重新生成。 Else use the following: 其他使用以下命令:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /entwurf/cob1/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

Secondly, what you are trying to achieve has to be done in two steps. 其次,您要实现的目标必须分两个步骤完成。

1) In Settings > General, change the wordpress url in both fields to www.cob1.org 2) In your apache config, set www.cob1.org to point to /entwurf/cob1/ 1)在设置>常规中,将两个字段中的wordpress网址都更改为www.cob1.org 2)在您的apache配置中,将www.cob1.org设置为指向/ entwurf / cob1 /

<VirtualHost *:80>
    DocumentRoot "complete-absolute-path-to/entwurf/cob1/"
    ServerName cob1.org
    ServerAlias www.cob1.org
</VirtualHost>

3) Verify that .htaccess is being read. 3)验证正在读取.htaccess。 This takes a little bit of experimentation. 这需要一些实验。 Eg. 例如。 I'd place some random text in .htaccess to force a server error on purpose. 我会在.htaccess中放置一些随机文本,以故意强加服务器错误。 If I see the error, that means that the .htaccess file is being read. 如果看到错误,则表示正在读取.htaccess文件。 If it's not being read, make sure "AllowOverride All" is set in the apache config. 如果未读取,请确保在apache配置中设置了“ AllowOverride All”。 .htaccess files are only read by apache (and apache family servers.) Restart apache. .htaccess文件仅由apache(和apache家族服务器)读取。重新启动apache。 You're done. 你完成了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM