简体   繁体   中英

How to disable Pretty URL in Laragon

How can i completely disable pretty URL feature of Laragon , so for example right now by default in Laragon pretty URL is set as {name}.test where {name} is root folder and test is any string of our choice. so in Laragon i access my wordpress admin ( root folder demo ) as:
http://demo.test/wp-admin/
but i want to access it as:
http://localhost/demo/wp-admin/

You can always access the page or web app with http://localhost URL.

If you don't want to use the "pretty url" (aka virtual host feature), you can turn it of in installer or in Laragon settings.

Images from https://laragon.org/docs/install.html : 在此处输入图像描述 在此处输入图像描述

Laragon doesn't remove existing virtual host configuration when you turn off "Auto virtual hosts" in configuration.

To remove the virtual host, you have to remove it from the etc/hosts file of your OS. You can use "Edit etc/hosts" from the Laragon's Menu. Remove the lines with #laragon magic! comment. Deleting a project using the Laragon's Menu removes the line from hosts too.

在此处输入图像描述

To fully cleanup the virtual server configuration, remove server_name from auto.{project}.test.conf

我向 Laragon 团队发送了一封电子邮件,他们说可以从未来的版本中完成。

What you describe is called base_url in wordpress it's called siteurl in the config.

Than just create an apache config like

<virtualhost *:80>
    servername localhost

    DocumentRoot /var/www/
    <Directory /var/www>
        AllowOverride All
        require all granted
    </Directory>
</Virtualhost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM