Note that there are some explanatory texts on larger screens.

plurals
  1. POhtaccess redirect for old site url
    primarykey
    data
    text
    <p>We have a client, where were building a new site. There old system had all articles under:</p> <p><a href="http://www.domain.com/articles" rel="nofollow">http://www.domain.com/articles</a></p> <p>The new site is</p> <p><a href="http://www.domain.com/resources/articles" rel="nofollow">http://www.domain.com/resources/articles</a></p> <p>Within the articles section url can be as long as:</p> <p><a href="http://www.domain.com/resources/articles/category-name/title-of-article" rel="nofollow">http://www.domain.com/resources/articles/category-name/title-of-article</a></p> <p>and there is</p> <p><a href="http://www.domain.com/resources/articles/page/#" rel="nofollow">http://www.domain.com/resources/articles/page/#</a> for the pagination</p> <p>The new site will have the same url structure of the old articles except for the /resources part.</p> <p>I need to have all incoming traffic that comes under:</p> <p><a href="http://www.domain.com/articles" rel="nofollow">http://www.domain.com/articles</a> redirected to <a href="http://www.domain.com/resources/articles" rel="nofollow">http://www.domain.com/resources/articles</a> however I need to make sure that the category name and the title of the article in the url string are also placed in from the old string that was requested to the new one.</p> <p>How can I do this using htaccess? </p> <p>--- EDIT ---</p> <p>Here is my current htaccess:</p> <pre><code>RewriteEngine on RewriteRule (.*) $1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/(.*)/(.*)$ ?cat=$1&amp;title=$2&amp;subtitle=$3 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/(.*)$ ?cat=$1&amp;title=$2 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) ?cat=$1 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload