homepage Welcome to WebmasterWorld Guest from 107.20.131.154
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque & physics

Webmaster General Forum

    
Does mod_rewrite automatically change URLs?
Should i be hardcoding rewritten URLs?
d0odx




msg:342437
 8:49 pm on Aug 19, 2003 (gmt 0)

hey guys im trying to make a dynamic URL static and ive got it to the point where i can goto make the following URL:

domain.com/?varname=var

translate into this:
domain.com/var_name/var

My question is now that i have that finished, do i have to Hard code all links to be domain.com/var_name/var/ instead of the dynamic URL, or does mod_rewrite do this automatically?

Its currently not doing it automatically, so im not sure what is happening.

 

claus




msg:342438
 9:00 pm on Aug 19, 2003 (gmt 0)

If the whole thing is about hiding the variables from the browser address line and the SE spiders, then you would only use this for your scripts:

1) domain.com/?varname=var

- and use this in links and everywhere else:

2) domain.com/var_name/var

mod_rewrite can make sure that the server "sees" no 1 when no 2 is entered in the browser, so that when asking for no 2, a visitor will get no 1 delivered (or the other way round).

I think you may have done it the other way round, so that no. 1 entered in the address line will be no. 2 on the server, and then your scripts will not work, but it's easy to fix, just reverse it :)

/claus

d0odx




msg:342439
 12:38 am on Aug 20, 2003 (gmt 0)

claus, thank you for responding, but im a little confused.

You are absolutely, right. I want SEs to be able to spider my links, i run a link site (almos like dmoz, but on a super small scale and only targeting a specfic type of site) but each catagory of links a diff variable call to a php script.

Are you saying that i have to Hard code all static links into my scripts?

I was under the impressions that by setting mod_rewrite to rewrite the URL, links on the pages are automatically changed from the dynamic URL that used to be displayed, to a static URL when viewed/spidered.

BlueSky




msg:342440
 1:13 am on Aug 20, 2003 (gmt 0)

Are you saying that i have to Hard code all static links into my scripts?

Yes.

I was under the impressions that by setting mod_rewrite to rewrite the URL, links on the pages are automatically changed from the dynamic URL that used to be displayed, to a static URL when viewed/spidered.

You have it backwards. The mod_rewrite takes a static looking url, peels off the variables, and converts it back to a dynamic url before the script executes it. So, you need to hardcode the static links not the dynamic ones.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved