0

I've built a Drupal website to a replace an old website (not in Drupal) and some of the pages changed urls. I need to create redirects for those pages.

I've thought of using Drupal's .htaccess file and have the following:

RewriteCond %{HTTP_HOST} ^www.example.com/old-page-name$
RewriteRule ^$ http://www.example.com/new-page-name [L,R=301]

But that didn't work.

I've added those lines inside the redirect block in Drupal's htaccess:

<IfModule mod_rewrite.c>
</IfModule>

Just under these rules:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

This will be a temporary solution until I install the redirect or some other module.

1 Answer 1

1

I'd suggest you consider the Rules module as that "other module" you are looking for. Using an approach as described in my answer to the question "How to use the Rules module to implement a custom redirect for an outdated URL?" ...

Using that technique, you can also solve your requirement about it being "temporary" (that's just a matter of some appropriate rules Condition to be added in your case).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.