Welcome to WebmasterWorld Guest from 34.226.234.20

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

.htaccess woe, pain, and grief

two domains, unwanted subfolders, stressed worker lol

     
2:39 pm on Apr 17, 2012 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 25, 2004
posts:161
votes: 0


hey guys
i have a second website in a subfolder /otherweb which gets redirected:


#redirect other sites
RewriteCond %{HTTP_HOST} ^(www.)?otherweb.com$
RewriteCond %{REQUEST_URI} !^/otherweb
RewriteRule ^(/)?$ otherweb/$1 [L]


so you dont see otherweb.com/otherweb in the url, only otherweb.com

this second site on my hosting a zend site so all pages go through index.php in the /otherweb folder


i'm trying to do away with more sub-folderage, but without much luck. ie:

otherweb.com/remove/this/but-keep-this-bit

changing to
otherweb.com/but-keep-this-bit

bearing in mind the actual path is really
otherweb.com/otherweb/remove/this/but-keep-this-bit

the zend htaccess in the otherweb folder looks like this:

RewriteEngine On
Options +multiviews +FollowSymlinks

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]



anyone know how i can get rid of those other two url parts?
1:03 pm on Apr 25, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15800
votes: 845


Two parts.

Redirect (RewriteRule with [R=301] flag) from long-messy-url to short-snappy-url, with preceding RewriteCond looking at THE_REQUEST. This determines what the user sees.

Rewrite from short-snappy-url back to long-messy-url where the content really lives.

Found this overlooked post while investigating whether that "10,000 previous posts" is accurate or just a wild exaggeration. May even be an understatement. Heh.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members