admin管理员组

文章数量:1289901

Trying to remove "/index.php/" from URL,

The .htaccess file location is

./var/www/html/.htaccess

and the content

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule (.*) /index.php/$1 [L]
</IfModule>

however it doesn't work, accessing a web page is possible only with "/index.php/".

Trying to remove "/index.php/" from URL,

The .htaccess file location is

./var/www/html/.htaccess

and the content

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule (.*) /index.php/$1 [L]
</IfModule>

however it doesn't work, accessing a web page is possible only with "/index.php/".

Share Improve this question edited Jul 8, 2021 at 15:52 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Jul 8, 2021 at 15:21 WindowsWindows 11 silver badge4 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

Go to Settings >Permalink Settings.

Check Post name

Click on Save Change button.

And this should be the default htaccess. WordPress can manage it's own htaccess so no need to manually add htaccess rules. I would delete your htaccess file and then save permalink settings.

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Problem is solved by changing the following line inside "httpd.conf" file:

AllowOverride None

to

AllowOverride All

本文标签: permalinksindexphp in URL