| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| DesignersTalk > Using mod_rewrite, is base href the best method for making things work? |
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
Senior Member
Join Date: Oct 2006
Posts: 2,174
|
Using mod_rewrite, is base href the best method for making things work?
I am just reading about mod_rewrite, and have just successfully made it work when testing on localhost. Though initially I had a problem making sure the links didn't break to files (images, js, css, etc) Here is my usual file structure when testing on localhost: localhost/website/index.php localhost/website/css/screen.css localhost/website/img/whatever.png localhost/website/js/library.js I then made a RewriteRule so pages/about -> index.php?page=1 But then all the links were broken on the page that was generated, as I link to "css/screen.css", "js/library.js", etc. So I am now using a <base href="http://localhost/website/" /> tag in the head of the page, and it makes sure the links dont become broken no matter which sub-directory of the website I am virtually in. Is this the best method of ensuring I don't get broken links, or should I be doing something else? |
|
|
|
|
|
#3 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,340
|
Why not set up Apache virtual hosts? I wrote Set Up a Local Web Development Server on Windows maybe you can get some help there? Otherwise, I'm pretty clueless when it comes to .htaccess and mod_rewrite still. |
|
![]() |