Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2011
    Posts
    10

    Default Problem creating 301 redirect if URL contains a question mark "?"

    Hello,

    Can someone help me create a 301 redirect?

    I'm trying to use cPanel to create a 301 redirect. The problem is that the URL I want to redirect from contains a question mark "?" which confuses cPanel.

    For example I want to redirect from
    h t t p://www.mydomain.com/index.php?option=component....
    to
    h t t p://www.mydomain.com/


    Because the original URL contains a ? cPanel ignores what's after the ? and creates a redirect
    from
    h t t p://www.mydomain.com/index.php
    to
    h t t p://www.mydomain.com/


    How can I solve this problem?

    Thank you

  2. #2

    Default

    In order to get a perfect solution for this problem, I would suggest you to contact our technical support department via live chat or send an email to our support department at support[@]eukhost.com from your registered email address and our technical support department will get this problem solved for you.

  3. #3

    Default

    Hello,

    looks like you using some application on your site like joomla/wordpress if so these applications come with redirect plugins which you can use to manage your redirection:


    Joomla Redirection plugin :


    Wordpress Redirection plugin :


    If you are using custom script then you can use htaccess but if the URL is dynamic and generated from Database in that case you might need to manage redirection mapping via database only.

    Thanks,
    Silvester J

  4. #4
    Join Date
    Jun 2007
    Posts
    313

    Default

    Hello,

    If you are running joomla on your website, then there are Search Engine Optimization friendly plugins available for Joomla which will help you with clean urls.

    Else, you can use following rule .htaccess file with will help to redirect h t t p ://www.mydomain.com/index.php?option=component to h t t p://www.mydomain.com/index.php

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^index.php /index.php?option=component.... [NC]

  5. #5
    Join Date
    Jan 2007
    Location
    Amersham
    Posts
    511

    Default

    Quote Originally Posted by NickJ View Post
    Else, you can use following rule .htaccess file with will help to redirect h t t p ://www.mydomain.com/index.php?option=component to h t t p://www.mydomain.com/index.php

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^index.php /index.php?option=component.... [NC]
    Wouldn't that do the opposite of what was required? ie redirect index.php to index.php?option=component (and incidentally it would redirect indexGphp as well cos the . should be escaped.

    Something like this would do the trick
    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^index\.php\?option=component /index.php [NC]
    David Allen - www.serina.co.uk

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •