[英]Remove index.php from wordpress URL
I am trying to remove index.php from wordpress url by following this video . 我正在尝试通过观看此视频从wordpress网址中删除index.php。
It doesn't work. 没用 Also I tried several other ways by editing .htaccess file. 我还尝试了其他几种编辑.htaccess文件的方法。 They all don't work. 他们都不工作。
In Permalink Settings, if I change the setting to 在“固定链接设置”中,如果我将设置更改为
http://xxxxxxxx/sample-post/ http:// xxxxxxxx / sample-post /
then the "about" page doesn't load, 404. All the ways to edit .htaccess doesn't work. 那么“ about”页面将无法加载404。所有编辑.htaccess的方式均无效。 I tried everybody, eg: all the methods in this page do not work. 我尝试了所有人,例如: 此页面中的所有方法均无效。
Try this code: 试试这个代码:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
RewriteEngine On
# On some hosts (including Rackspace), you need to remove the "#" that comes before RewriteBase to avoid 404 errors:
# RewriteBase /
# Block access to hidden files and directories.
RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpe?g|gif)$ $1.$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
</IfModule>
All my attempts do not work, except this one: 除了这一项以外,我所有的尝试均无效:
http://www.jarrodoberto.com/articles/2011/11/enabling-mod-rewrite-on-ubuntu http://www.jarrodoberto.com/articles/2011/11/enabling-mod-rewrite-on-ubuntu
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All <- HERE
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All <- HERE
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
I got this from this question on stackoverflow by 'Jarrod' at the bottom. 从我得到这个这个底部的计算器提问“贾罗德”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.