最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

htaccess - Pretty Url not working on the server

matteradmin5PV0评论

I have a wordpress website however I am not able to make the pretty permalinks work on it. The htaccess fil is writable on the server with file permissions 777.

So kidly guide me on the issues and how can I fix it. Here's the code for .htaccess file

# 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

I have a wordpress website however I am not able to make the pretty permalinks work on it. The htaccess fil is writable on the server with file permissions 777.

So kidly guide me on the issues and how can I fix it. Here's the code for .htaccess file

# 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
Share Improve this question edited Mar 20, 2019 at 6:13 Pratik bhatt asked Mar 20, 2019 at 6:03 Pratik bhattPratik bhatt 1,2882 gold badges13 silver badges27 bronze badges 4
  • can you please put your code here of .htaccess. – user147874 Commented Mar 20, 2019 at 6:06
  • Is it Apache? Is mod_rewrite installed and enabled? Wordpress is in the root directory or subdirectory? – nmr Commented Mar 20, 2019 at 7:20
  • Check similar questions e.g. this. – nmr Commented Mar 20, 2019 at 7:26
  • this is not code issues but its server issues please check it is your server is not shared server it is dedicated server so you need to config your self okay. – user147874 Commented Mar 20, 2019 at 10:46
Add a comment  | 

1 Answer 1

Reset to default 0

If you have dedicated server then you must follow the below steps to run with .htacess

first of note that you need to create a configuration file for each site on your server using FTP.

as below

/etc/apache2/sites-available

go above path and then create file with below formate

e.g.

domain_name.domain_extension.conf

{ hello.conf }

add below code into it

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName hello
    ServerAlias www.hello
    DocumentRoot /var/www/html  # your site data path
    <Directory "/var/www/html"> # your site data path
       Options FollowSymLinks
       AllowOverride All  
       Order allow,deny
       Allow from all
    </Directory> 
    ErrorLog /dev/null
    CustomLog ${APACHE_LOG_DIR}/access.log combined  # to check your log 
</VirtualHost>

after setup it.

please switch your permalink two-time vice versa and update your link in WordPress database.

and check I hope its working.

If not working, please restart apache server then.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far