homepage Welcome to WebmasterWorld Guest from 54.211.95.201
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
rewrite rule has me stumped
stumped on this one
bwnbwn




msg:4678021
 4:14 pm on Jun 6, 2014 (gmt 0)

This url is in the Google index and it resolves to the home page

http://www.example.com/index.php?no_redirect=true

so I tried these 2 rules that did not redirect. This is a new url to me so I am wondering if no_redirect in the url is stopping a redirect.

I tried
Redirectmatch 301 index.php?no_redirect=true http://www.example.com/

and
rewriterule ^index.php?no_redirect=true(.*)$ http://www.example.com/$1 [r=301,nc]

Stumped. Thanks for any suggestions.

 

not2easy




msg:4678037
 5:01 pm on Jun 6, 2014 (gmt 0)

The plain old rewrite that people use to take care of www is taking it to the home page. (I'm assuming that you have something like this in place for that www?):
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

If you redirect that to another page called /index.php you could cause a server error by looping.

bwnbwn




msg:4678046
 5:26 pm on Jun 6, 2014 (gmt 0)

after reviewing more info, this is a mobile redirect issue, so the advice is to add it in WMT under parameters and select used for tracking then add to robots file to block indexing.

BTW I discovered another url to redirect.

I have index.php redirected and found a person linking to
index.php/ this one resolved so I added it to the be redirected as well.

I assumed it is a joomula deal never had to do this before so I just tested few other sites and it resolves for them as well. One was a php and one was a index.aspx/

lucy24




msg:4678051
 6:00 pm on Jun 6, 2014 (gmt 0)

mod_alias (Redirect by that name) won't work, because it can't see the query string. You need to convert all your redirects to mod_rewrite and use a RewriteCond looking at %{QUERY_STRING}, plus %{THE_REQUEST} if you've got behind-the-scenes rewriting going on. (I really hope this is not the case, because then you shouldn't be using mod_alias at all.)

I am wondering if no_redirect in the url is stopping a redirect.

Only if your own site's code says so.

:: wait, stop, rewind ::

I assumed it is a joomla deal

You are rewriting, then. (WordPress/ Joomla / Drupal are all based on mod_rewrite.) Don't use mod_alias.

You can go into gwt and see what parameters they've already got listed. If there are any you don't use, click the appropriate buttons.

Within your own htaccess, you can also redirect any requests using parameters you don't actually use. But it probably isn't worth the bother unless you are really infested.

bwnbwn




msg:4678074
 7:50 pm on Jun 6, 2014 (gmt 0)

not infested only 2 so I added in WMT and set as tracking than added a wildcard disallow in text file

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved