简体   繁体   中英

htaccess redirect to subfolders resources

I have a problem:

I have to modify an application written in Zend 1 that was deployed to the domain root. now to test it the customer gave me a root subfolder called [domain]/social

When I run it, I have a lot of problem because all paths are like "/resource", but in this case the fiddler show me that the request look for [domain]/resource ad not for [domain]/social/resource.

It happens with script sources, ajax urls, hrefs...all!

Is there a way to fix the problem?

I am not quite familiar with Zend, but is there a main config file that sets the application root folder? (Like joomla) You can modify that if it exists.

Other option would be to preg_match or str_replace all instances of the domain name in the code ( like when moving a Worpress site) but you should definately do that with a sample content not couple hundred pages).

And here is a htaccess snippet as well:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/social/$1 [R=301,L]

Be sure to put the htaccess under the development folder not under the root, oterwise you're facing issues.

I suggest cheking for a config file first. Hope one of this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM