Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite newbie question

         

coopersita

5:13 pm on Dec 1, 2006 (gmt 0)

10+ Year Member



Hi,

I don't know much about htaccess files, but I know that you can rewrite php like urls into readable urls, right?

I have an online calendar, and I want to be able to use iCal to subscribe to calendars. My problem is that the calendar is outputting urls as:

webcal://www.mydomain.com/iCal/?output_ics=1

iCal doesn't like that. I think I can fix the problem by changing the urls to something more like:

webcal://www.mydomain.com/iCal/calendar.ics

Can I do that with an htaccess file and mor_rewrite?

Thanks.

jdMorgan

7:28 pm on Dec 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You cannot change URLs on pages using mod_rewrite, you can only change the server filepaths associated with those URLs when they are requested from your server, or redirect from one URL to another.

You'll need to change the links that appear on your pages by changing the underlying script(s).

I cannot address iCal, because I don't know what it is. But you *can* use "cosmetic" URLs on a site -- URLs which don't actually point to real pages, and then use mod_rewrite to map them so that they do point to real pages. However, your pages or scripts must be modified to present those cosmetic URLs to browsers and search engine robots.

URLs and filepaths are two different systems used to identify content, and they need have nothing in common; It is the server that maps URLs to server files or to scripts.

Hopefully, that clarifies things a bit. If not, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim