skip to Main Content

WordPress – How to properly rewrite a post tag?

Suppose I have a post tag which have as term id 480, I'm trying to create a redirect using add_rewrite_rule, so far I did: function term_custom_redirect() { $referer_url = "en/tag/a-lange-sohne"; add_rewrite_rule( "^$referer_url/?$", 'index.php?p=' . 480, "top" ); flush_rewrite_rules(); } add_action('init',…

VIEW QUESTION

Apache – Pretty URLs with .htaccess rewrite engine

Hej, I'm trying to achieve a pretty urls for my site with rewrite engine. The goal is this - mysite.dk/da, mysite.dk/da/success and mysite.dk/da#scroll. So far my htaccess file looks like this: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule…

VIEW QUESTION

Php – htaccess problem with empty string in URL

I want users to only be able to access domain.com or domain.com/. Anything afterwards, even domain.com/index.php, should redirect to domain.com. I have this .htaccess RewriteBase / RewriteEngine On Options -Indexes RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTPS} =on…

VIEW QUESTION
Back To Top
Search