redbrad0 Posted June 8, 2007 Share Posted June 8, 2007 I have a .htaccess file that is very small and simple. Everything works fine with this. So if I goto http://www.domain.com/wikiNew/ it actually loads the wiki_live data. Now the only problem is before I added in this htaccess file are url's used to be all screwed up and looked like this Old: http://www.domain.com/wikiNew//index.php/Something/AndSomething/ New: http://www.domain.com/wikiNew/Something/AndSomething/ So in the htaccess file how can I add in a rewrite that will direct anything at wikiNew//index.php/??? to wikiNew/??? Current htaccess file RewriteEngine On #RewriteBase /~username RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wikiNew/(.*) wiki_live/index.php?title=$1 [PT,L,QSA] RewriteRule ^wikiNew/*$ wikiNew/ [L,QSA] RewriteRule ^/*$ wikiNew/ [L,QSA] Quote Link to comment Share on other sites More sharing options...
redbrad0 Posted June 8, 2007 Author Share Posted June 8, 2007 I thought I might add that wikiNew is not a real directory on the server. Quote Link to comment Share on other sites More sharing options...
per1os Posted June 8, 2007 Share Posted June 8, 2007 I would actually send anything to wikiNew/index.php to a file and in that file send a 301 redirect header and than redirect them to the new properly formatted URL. It will be easier to just use PHP for the redirect portion if you ask me. Quote Link to comment Share on other sites More sharing options...
redbrad0 Posted June 8, 2007 Author Share Posted June 8, 2007 I agree and I would rather it goto its own php file so I can display to the end user they need to update their bookmarks. This is not a external site, so I am not worried about search engines or anything else. Basically I just want the employees that have url's bookmarked to get a message that the bookmark needs to be updated. Just as a test to send the user to a correct url, I have tried the following line in the .htaccess file on the root of the site but it does not seem to redirect the user. Any ideas what I can try? RewriteRule ^wikiNew//index.php/(.*)/(.*)/ wikiNew/$1/$2/ [PT,L,QSA] RewriteRule ^wikiNew//index.php/(.*)/ wikiNew/$1/ [PT,L,QSA] Quote Link to comment Share on other sites More sharing options...
redbrad0 Posted June 11, 2007 Author Share Posted June 11, 2007 Can anyone help me with this? 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.