admin管理员组

文章数量:1332353

I am able to access main page on localhost but not able to access page that I have added.it is displaying 404 error.

my question is same as : but re-posting here as in that link no proper answer posted.

httpd.conf SETTINGS

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

<Directory "E:/xampp/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # .2/mod/core.html#options
    # for more information.
    #
    #Options Indexes FollowSymLinks Includes ExecCGI
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

HTACCESS FILE CODE

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

# END WordPress

mod rewrite also enabled

LoadModule rewrite_module modules/mod_rewrite.so

I am able to access main page on localhost but not able to access page that I have added.it is displaying 404 error.

my question is same as : https://stackoverflow/questions/12311737/permalinks-is-not-working-in-xampp-localhost-server-on-windows-7 but re-posting here as in that link no proper answer posted.

httpd.conf SETTINGS

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

<Directory "E:/xampp/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache/docs/2.2/mod/core.html#options
    # for more information.
    #
    #Options Indexes FollowSymLinks Includes ExecCGI
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

HTACCESS FILE CODE

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

# END WordPress

mod rewrite also enabled

LoadModule rewrite_module modules/mod_rewrite.so
Share Improve this question edited Sep 12, 2017 at 6:56 Porosh Ahammed 3232 silver badges10 bronze badges asked Dec 26, 2014 at 9:38 Pragnesh ChauhanPragnesh Chauhan 1116 bronze badges 4
  • Why is your rewrite rule RewriteRule . /perms/dev/index.php and not RewriteRule . /index.php? – fuxia Commented Dec 26, 2014 at 10:27
  • toscho perms/ is main directory and dev is my subdirectory – Pragnesh Chauhan Commented Dec 26, 2014 at 10:35
  • Well, yes, but you have set that as RewriteBase already. – fuxia Commented Dec 26, 2014 at 10:40
  • yes, I have install fresh copy of wordpress and set permalink by %postname% and with new copy permalink working fine but not working for my existing code :( – Pragnesh Chauhan Commented Dec 26, 2014 at 10:50
Add a comment  | 

1 Answer 1

Reset to default 1

In xampp/apache/conf/httpd.conf, under Dynamic Shared Object (DSO) Support, enable mod_rewrite. Uncomment the line:

LoadModule rewrite_module modules/mod_rewrite.so

Then restart the server, and set the permalinks in WordPress again.

本文标签: htaccessxammp server permalink by postname not working