Jump to content

htaccess file rewrite question


redbrad0

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/54773-htaccess-file-rewrite-question/
Share on other sites

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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.