WebFaction
Community site: login faq

Hello, i installed a drupal 7 website and i want to use wordpress and my drupal site together. i created a drupal 7 application and wordpress application, then i linked my drupal 7 app to my root directory "/" and wordpress app to "/blog" paths.

On my drupal 7 website in my main navigation i have a blog link, which is linked to mysite.com/?q=blog url, but i cannot redirect it to mysite.com/blog url, when i directly enter mysite.com/blog url to my browser i can reach my wordpress site, it seems simpe but i cannot redirect ?q=blog url to just "blog " path...

thanks in advance

asked 07 Oct '11, 04:31

realbezo
111
accept rate: 0%

Hi,

Can you provide some more information on how you are doing the redirection? Do you use Rewrite rules in .htaccess? Please paste them here if so.

(07 Oct '11, 04:45) todork

RewriteRule ^?q=blog$ http://www.myysite.com/blog [R=301,L] i tried this but nothing changes

(07 Oct '11, 05:06) realbezo

and when i try RewriteRule ^?q=blog$ http://mysite.com/blog [R=301,L]

i get

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

(07 Oct '11, 05:17) realbezo

Hi,

You can't match the GET parameter "q" inside the Rewrite rule. You need to use the RewriteCond directive for this. Here are the Rewrite rules you need to use in order to do such a redirection:

RewriteEngine on

RewriteCond %{QUERY_STRING} q=blog

RewriteRule ^.*$ http://www.mysite.com/blog [R=301,L]

If you still have troubles using these rules, please open a support ticket, and we will look at your .htaccess.

permanent link

answered 07 Oct '11, 05:31

todork
1.2k5
accept rate: 34%

thank you, it worked, i can open now my wordpress site

by the way the rule redirects me not http://www.mysite.com/blog/ url instead it redirects me to http://www.mysite.com/blog/?q=blog url but it still works, and opens my main wordpress page p.s. i think i have really little knowledge about rewrite rules and htaccess file, thank you for patience and help

(07 Oct '11, 06:34) realbezo

You are most welcome! Yes, unfortunately the GET parameter gets passed to the new URL as well - I'm not aware of a way to bypass this.

(07 Oct '11, 06:38) todork
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×245
×63

question asked: 07 Oct '11, 04:31

question was seen: 4,428 times

last updated: 07 Oct '11, 06:38

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM