Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Hidden rewrite rule.

     

sixander

2:20 pm on Aug 16, 2013 (gmt 0)



Okey so Im a bit new at this and I recently took over a site for a small business. And now I have two issues wich I think is ht access based.

Number 1. when I try to rewrite using 301 it ads a url string to the url wich #*$!s up my rewrite so either way I get a 404.
I have tried to put the 301 at the beginning of the file so that it would read those files first but and I cant seem to find the rule wich tells it to ad the string.

Number 2. I tried to ad the google author tag in the footer but for some reason the outoing link to the goolge+ account starts with www.mydomain.com wich is really wierd becaus the code clearly specifys ref plus.google.com/nnnnnnn ....might be connected with the earlier issue.

Im at a loss, anyone hade simular problems?

phranque

9:01 pm on Aug 16, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, sixander!


1 -
By default, the query string is passed through unchanged.
...
When you want to erase an existing query string, end the substitution string with just a question mark.

[httpd.apache.org...]

2 - you need to specify a fully qualified url starting with the protocol - http://...

lucy24

9:48 pm on Aug 16, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



when I try to rewrite using 301

Can't be done. Crystal ball suggests that what you're trying to do is
#1 issue a 301 (permanent) redirect
#2 using mod_rewrite

If so, the first thing you need to do is take any existing redirects done with mod_alias (Redirect by that name) and reword them to use mod_rewrite (RewriteRule by that name).

I have tried to put the 301 at the beginning of the file

At the beginning of what file? The page itself? htaccess? The config file?

I tried to ad the google author tag in the footer but for some reason the outoing link to the goolge+ account starts with www.mydomain.com wich is really wierd becaus the code clearly specifys ref plus.google.com/nnnnnnn ....might be connected with the earlier issue.

This would seem to be flat-out impossible, unless your page code is first processed by a php script that automatically adds your domain name to the front of all links. Once the page has reached the user, nothing more can happen to it. Outbound links will never see your own server.


You said you've taken over someone else's site. What level are you working at? The page code itself, or pages plus htaccess, or the whole server?

phranque

5:46 am on Aug 17, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



At the beginning of what file? The page itself? htaccess? The config file?


the OP mentioned "ht access", so i am assuming these directives are in the .htaccess file.

sixander, can you verify that?
please post the exemplified code that you are using for rewrites and redirects.

IMPORTANT: Please Use Example.com For Domain Names in Posts:
http://www.webmasterworld.com/apache/4452736.htm [webmasterworld.com]
This would seem to be flat-out impossible, unless your page code is first processed by a php script that automatically adds your domain name to the front of all links. Once the page has reached the user, nothing more can happen to it.


to most browsers, a url without the protocol specified looks like a relative url.
if it looks like a relative url, then the browser will request from the current hostname.

lucy24

6:10 am on Aug 17, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Yes, that's what I meant. If it's already got some other domain name in it-- which the OP clearly said it does-- then what browser would tack on an additional domain name? Not even MSIE would do that ::snrk::

phranque

8:01 am on Aug 17, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



in this case the browser would prepend not only the hostname but the current path as well.
in the browser context, it's not a hostname until you specify the protocol.
to the browser href="plus.google.com/nnnnnnn" looks like href="arbitrary.dot.separated.relative.subdirectory.name/nnnnnnn" while href="https://plus.google.com/nnnnnnn" is unambiguous.

lucy24

10:44 am on Aug 17, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



We need a more exact reading of:
the code clearly specifys ref plus.google.com/nnnnnnn

If the link in the page code literally says
<a href = "plus.google.com/blahblah">
then yes I can seen where an unsuspecting browser would make it into
http://www.example.com/path-to-this-page/plus.google.com/blahblah
But it it says
<a href = "http et cetera
then something has gone bonkers :)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month