dongqian9567 2016-06-10 10:21
浏览 49

Wordpress永久链接问题与index.php

Why is this sample domain www.example.com/about-us is not working even though I activate the .htaccess

AddHandler php-stable .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

also when you navigate also this link www.example.com/index.php/about-us it will redirect you to this www.example.com/about-us which is not working but when you navigate this www.example.com/Index.php/about-us that's the time the url is working. Please help. It host on godaddy

  • 写回答

2条回答 默认 最新

  • douhui1957 2016-06-10 11:06
    关注

    Seems like you are having a mod_rewrite issue with your hosting. You can create a .php page on your server lets call it phpinfo.php and write the following code in it

    <?php
       phpinfo();
    ?>
    

    Open this page in browser and look for mod_rewrite setting. It needs to be on for permalink to work.

    Now, go to your WP Admin Panel -> Settings -> Permalink and choose /post_name/ Wordpress will automatically write in .htaccess file (provided it can access it).

    If mod_rewrite is not enabled on your server, there is no way other than contacting your hosting provider to enable it. It is enabled by all hosting providers still you have to cross check using phpinfo.

    Following is a perfectly valid .htaccess file for WordPress

    # 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
    

    Also ensure that apache.conf is configured to be overridden by .htaccess file. Apache settings like AllowOverride none; ensure .htaccess is not honored.

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图