Estoy tratando de adjuntar a wordpress un parámetro adicional en mi URL. Por ejemplo, tengo la URL: http://example.com Quiero cambiar eso a URL: http://example.com/this-example/
Pienso que puedo hacer esto en el acceso htac en la línea de una condición de reescritura, pero no estoy seguro de cómo hacerlo. Esto es lo que estaba pensando aquí.
Htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine on
RewriteRule ^/this-example/(.*)/ /index.php?$1 [L]
</IfModule>
Options -Indexes
Respuestas
1 para la respuesta № 1Puedes intentar esto:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{THE_REQUEST} !^/this-example [NC]
# use your own host here, for me is 192.68.10.10
RewriteCond %{HTTP_HOST} 192.168.10.10$ [NC]
RewriteRule !^this-example/ /this-example%{REQUEST_URI} [L,R,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^this-example/(.*)$ $1 [L,QSA]
</IfModule>
Options -Indexes