MusicMetabolism Posted June 22, 2012 Report Share Posted June 22, 2012 This is concerning a htaccess file and mod_rewrite. i have two domains/urls,(just got the second domain/url today and am working on a webpage) the first url being used for the root directory the second i pointed to a folder inside the main/root directory which should load the webpage when i type in the url in the web browser. however it only loads the webpage index.html file (when i rename the htaccess file from the original name htaccess to htaccess1) or when i type in the full path www.example.com/index.html. the htaccess file is preventing the second url from loading the index.html file inside of the sub-directory. by just typing www.example.com. ( Note: the htaccess file was coded by another coder who created the first webpage, and he is no longer working with us ) i am trying to make the second url work as well with out having to type the full path www.example.com/index.html and with out messing up the code in the htaccess which works for the other domain name. The current code looks like this. ( i use www.EXAMPLE.com in place of the working url ) <IfModule mod_rewrite.c> RewriteEngine on MultiViewsMatch Handlers Filters RewriteCond %{http_host} ^www.EXAMPLE.com [nc] RewriteRule ^(.*)$ http://EXAMPLE.com/$1 [r=301,nc] RewriteRule ^([^/\.]+)/?$ /category.php?cat=$1 [L] </IfModule> if anyone can figure this out or let me know what to put in to make both domains work it would be great-Thanks Quote Link to comment Share on other sites More sharing options...
khanahk Posted August 13, 2012 Report Share Posted August 13, 2012 (edited) It's been a while but perhaps this will help you. http://www.generateit.net/mod-rewrite/ It will generate the mod-rewrite code for your .htaccess file if you specify the old URL and where you want it to go now Edited August 13, 2012 by khanahk Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.