Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does Apache rewrite rule automatically change the URL of all pages without editing links?

I tried rewriting Apache rule from .htaccess, but nothing happened, so I'm wondering if I need to edit the links.

share|improve this question

1 Answer 1

The rewrite rule is generally used to rewrite request headers, and to forward requests to other back-end servers based on patterns and regular expressions, and is not (I don't think it can be, but its kind if super powerful, so who knows... ;-) used to rewrite the body content.

You can think of mod_rewrite as a tool to map the external string http://myhost.com/some/path/here onto some internal file /var/www/html or virtual location server-status (or proxied external location, http://tomcat:8080) etc

If you want to rewrite links and HTML strings in the body text there is a apache module called mod_substitute which is useful for that. If you have an old apache, there are other mod_replace and mod_perl/

If you want to replace, delete or modify headers or cookies, mod_headers is a good place to look.

(However there is some cross over between these various modules, so its likely you you would want to be more clear about your requirements in order to get a better answer)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.