9 – How do I programmatically create a path alias?

9 – How do I programmatically create a path alias? – Drupal Answers

8 – How do I create an alias for the node edit page?

Use a src/Routing/RouteSubscriber.php file in your module.

namespace DrupalexampleRouting;

use DrupalCoreRoutingRouteSubscriberBase;
use SymfonyComponentRoutingRouteCollection;

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection->get('entity.node.edit_form')) {
      $route->setPath('/project/{node}/edit');
    }
  }

}

Use a example.services.yml file in your module (if the module is named example).

services:
  example.route_subscriber:
    class: DrupalexampleRoutingRouteSubscriber
    tags:
      - { name: event_subscriber }

https://www.drupal.org/docs/8/api/routing-system/altering-existing-routes-and-adding-new-routes-based-on-dynamic-ones

navigation – How do you batch process a path alias change for nodes that includes a menu placement change?

We have an annual reporting sites that contains approximately 200 nodes each year. When the next year’s reports are complete, all of the current year’s nodes move to a path like /archives/fy2020/*. Not only do their paths change, but the menu items change as well to 1] create a new entry year 2] move menu items to the new entry year as the parent.

I am looking at what type of batch process I can used to identify and confirm the nodes that need to “move” and the execute the path and menu changes. Tips and pointers would be helpful.

How to get specific content in view from URL alias drupal 9?

How to get specific content in view from URL alias drupal 9? – Drupal Answers

windows10 – Apache2.4 server Falla en iniciar cuando configuras alias en Windows 10

ya lei el manual de apache he hice busquedas en google y https://serverfault.com y https://stackoverflow.com en ingles pero las recomendaciones que consegui son las mismas que ya yo tengo seteadas aca

que quiero en el browser : localhost/vcore/ > y que el navegador me lleve a la web que estoy desarrollando

Mi .conf file

httpd.conf: (note: los puntos hacen refererncia al texto estandar el archivo)

LoadModule alias_module modules/mod_alias.so
.
LoadModule vhost_alias_module modules/mod_vhost_alias.so
.
<IfModule alias_module>
    Alias /vcore/ "D:/project/code/VCore/"
    .
    ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"
</IfModule>
.
.
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Alias
Include conf/extra/httpd-alias.conf

ahora en el conf/extra/httpd-vhosts.conf file :

<VirtualHost vcore:80>
    ServerName vcore.com
    ServerAlias /vcore/ 
    DocumentRoot "D:/project/code/VCore/"
    ErrorLog "D:/project/code/VCore/apache-logs/vcore-ERROR.log"
    CustomLog "D:/project/code/VCore/apache-logs/vcore-acces.log common
</VirtualHost>

y finalmente en el archivo conf/extra/httpd-alias.conf :

<Directory "D:/project/code/VCore/">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride all
    Order allow,deny
    Allow from all
    Require all granted 
</Directory>

….. el apache server no arranca, la unica vez que lo logre arrancar fue cuando agregue el alias Alias /vcore/ "D:/project/code/VCore/" en httpd.conf sin incluir el Include para httpd-alias.conf y httpd-vhosts.conf peor lo que obtuve en el browser fue

Forbidden

You don’t have permission to access this resource.

apache 2.4 – Apache2.4 server Fail to start when alias is setup in Windows 10

I already read the apache manual I have done searches in google and https://es.stackoverflow.com in Spanish but the recommendations I got are the same that I already have set here

What I want in the browser : localhost/vcore/ > and browse to the web I’m developing

My .conf file

httpd.conf: (note: the dots down there means standard text in the file)

LoadModule alias_module modules/mod_alias.so
.
LoadModule vhost_alias_module modules/mod_vhost_alias.so
.
<IfModule alias_module>
    Alias /vcore/ "D:/project/code/VCore/"
    .
    ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"
</IfModule>
.
.
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Alias
Include conf/extra/httpd-alias.conf

now on the conf/extra/httpd-vhosts.conf file :

<VirtualHost vcore:80>
    ServerName vcore.com
    ServerAlias /vcore/ 
    DocumentRoot "D:/project/code/VCore/"
    ErrorLog "D:/project/code/VCore/apache-logs/vcore-ERROR.log"
    CustomLog "D:/project/code/VCore/apache-logs/vcore-acces.log common
</VirtualHost>

and finally in the conf/extra/httpd-alias.conf :

<Directory "D:/project/code/VCore/">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride all
    Order allow,deny
    Allow from all
    Require all granted 
</Directory>

….. the apache server just don’t run, the only time I got it ran was when I add the alias Alias /vcore/ "D:/project/code/VCore/" in httpd.conf without add the Include for httpd-alias.conf and httpd-vhosts.conf but what I get in the browser is

Forbidden

You don’t have permission to access this resource.

http status code 404 – Nginx server gives 404 for my location alias

I am trying to arrange a location alias for anyone get through mydomain.com/game/admin url, make sure the anginx server to pull the content exists in /var/www/html/my-cakephp-app/ directory. My application is built using cakephp framework and its directory structure is shown below:

  • /var/www/html/my-cakephp-app/
    • admin
      • Config
      • Console
      • Controller
      • View
      • webroot (App entry-point index.php file exists in this directory)

Also I have static html/css website located in the /var/www/html directory. So anyone with mydomain.com url can see that website too.

Here is my current nginx server block:

server {
    listen 80;
    listen (::):80;

    root /var/www/html;

    index index.html index.htm index.php;

    server_name mydomain.com;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ ^/game/admin/ {

                alias /var/www/html/my-cakephp-app/admin/webroot;
                try_files $uri /game/admin/index.php$is_args$args;
  
                location ~* ".php$" {
                  include snippets/fastcgi-php.conf;
                  fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
                  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
               } 

    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /.ht {
        deny all;
    }
}

With this setup, my static web-site working fine. But cakephp application gives 404 not found error in browser. No any errors in the nginx/error.log.

But when I run with below nginx configuration, my application works fine. But I have to get rid of my html/css site.I am planning to upgrade html/css app with a wordpress site. So I should have the ability to run the wordpress site as the parent.

server {
    listen 80;
    server_name mydomain.com;
    root /var/www/html/my-cakephp-app/admin/webroot/;
    
    index index.html index.htm index.php;
 
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
        autoindex on;
    }
    
    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    
    location ~ /.ht {
        deny all;
    }
}

I couldn’t think of what I have done wrong in the first server block. Any suggestions would be really helpful.

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies Proxies123.com