简体   繁体   中英

Very simple mod_rewrite questions

1- Does mod_rewrite means that if I make this url:

  domain.com/ad.php?id=8498292

INTO

  domain.com/8498292

that all links on my website will have to be changed to the later above?

example the link: domain.com/ad.php?id=8498292 wont work now, unless I replace it with domain.com/8498292 ? Or will the server know that they are the same still?

2- Will the rewritten link appear rewritten in the browsers adress bars also, so if I enter domain.com/ad.php?id=8498292 it will actually appear as domain.com/8498292 in the adress bar itself?

3- Will images and all other related links and material on the page whose link is rewritten remain intact? ie will pictures and links still work FROM that page which are relative?

Thanks

  1. You can write the rules such that both will work, but generally you'll want the links to be in the "clean" format for when search engines index your pages.

  2. mod_rewrite can do an internal rewrite if the pages are on the same domain. One would have to use the [R] flag to force an external redirect if that was desired.

  3. You can make the rules as expansive or as restricted as necessary in order to avoid rewriting media URLs. RewriteCond has a number of ways to test the viability of rewriting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM