Posts

Showing posts with the label apache

How to host Laravel application in a sufolder along with normal php application?

How to host Laravel application in a sufolder along with normal php application? I have a laravel application and a normal application. I want the normal application to run when user opens example.com/ but when the user opens example.com/laravel_application/ I want the laravel application to run. How can I achieve this. I tried various methods like creating symlinks but I seem to be always redirected to root directory ( example.com/ ) e.g. when I open example.com/laravel_application/login I am open to using apache or nginx. example.com/ example.com/laravel_application/ example.com/ example.com/laravel_application/login 3 Answers 3 It's easier to add a subdomain for Laravel app. Otherwise, you will have to create Laravel routes based on the example.com/laravel_app path. There are two solutions: Create .htaccess file on sub-folder where you put your laravel application. and add the code in .htac...

Apache two apps one domain share language /en - Magento & Wordpress

Apache two apps one domain share language /en - Magento & Wordpress We have Wordpress in the root / in a physical subfolder /wp and Magento in /products. We are wanting to make the sites multi-language using sub folders e.g domain.com/en The problem arises as magento appends the store code (language) after the url so we have domain.com/en (wordpress) domain.com/products/en (magento) Naturally we would like domain.com/en domain.com/en/products Now it's very easy to make it work with some rewrite rule RewriteRule ^(.*)/products/?(.*)$ /products/$1 [L] But still we have an issue as Magento generates the links as /products/en it's possible to start modifying where these links are generated like in MagentoStoreModelStore In the _updatePathUseStoreView function, this doesn't seem to handle all links though In general seems like a bad solution, another idea is to use Apache mod_substitute also seems bad practice, and overhead. Another option is to have both apps in the root an...

RedirectMatch not workding with Forward Chaining Proxy in Apache

RedirectMatch not workding with Forward Chaining Proxy in Apache I am trying to configure apache server as a forward proxy chaining to another (internet)proxy while at the same time including RedirectMatch directives to redirect certain urls to the local host instead of chaining to the remote proxy. diagram http://www.plantuml.com/plantuml/png/TP7DIiH03CVlUOhGUt6zBQMKLK4GL9O57s1s6cbXd9GqQzUtDsLBwTHwcKFoc_y7EVJgH2zV0SvynUpub45dWzQtdOkAZy93JvBCieVE-OQA_Mw_ox0iFra69pLsmjUVgjfcxqToeBE9VPCOHR56iqpevvlISHHA5YzHII8fm1G8ysgLey2B1711yKHrA-JrpQblvWzbdl_v8HE9oXZOkz1mhvRrBjBmSNfTcYLD2bm19fuGGA4dVETRXDGshvAUK_3bo92vyTRQtERzIdnSBTd_wyDu0JZOOyV_1G00 The redirect without the forward proxy chaining directives works. The forward proxy chaining works with or without the redirect directive but if I have both the redirect and the chaining configured any url that matches the redirect returns a 404 Here is a copy of the conf ServerRoot "c:/bin/Apache24" Listen 81 ... Listen 8080 <VirtualHost *:8...

apache ubuntu forward ip to url name

apache ubuntu forward ip to url name I have some services running on an old computer running ubuntu server, and they resolve to an ip address and a port number, like 192.168.1.166:6789 brings me to that services web UI. I also have apache running on this box which is hosting another service so when i visit 192.168.1.166 WITHOUT the port number at the end, it brings me directly to that web UI for that service. I am a total newbie to linux so i have just been following tutorials to get this all setup and dont have a good grasp on what files to modify to accomplish this. So basically i want to setup apache (or anything else through ubuntu) that will forward 192.168.1.166:6789 to say "http://myService" or "http://myService.com" so its easier for non-technical people in the house to pull these web UI's up (not sure what format is valid for local urls, again i am a big time newbie with all this). Thanks! ...

Redirect any directory if it has a specific query string

Redirect any directory if it has a specific query string I am trying to redirect all pages with a specific query string to another page. So many pages have this query string, but the URI's are different. I want to capture any URI and if it has this query string to redirect it but nothing I am doing is working. So just to be clear: http://example.com/?redirectme=1 would redirect to http://example.com/newpage while also: http://example.com/randompage/rtandomsirectory?redirectme=1 would also redirect to http://example.com/newpage I am sure there must be 2-3 lines I can put in the htaccess to do this but it is not working. This is a wordpress site if that should make a difference. Here is what I have tried: RewriteCond %{REQUEST_URI} ^/(.+) RewriteCond %{QUERY_STRING} ^redirectme=1$ RewriteRule ^/?$ http://example.com/? [R=301,L] and RewriteCond %{REQUEST_URI} ^/(.+) RewriteCond %{QUERY_STRING} ^redirectme=1$ RewriteRule (.*) http://example.com/? [R=301,L] different variations: Rewrite...

Spurious, but frequent double slashes in path after Apache mod_rewrite

Spurious, but frequent double slashes in path after Apache mod_rewrite A client wants to strengthen his main brand and consolidated the content of the various domains used for the respective sub-brands in subdirectories under the hood of his main domain (brand): www.example.com |_ .htaccess |_ brand1 |_ files |_ includes/header.inc |_ scripts/functions.php |_ brand2 |_ brand3 All hitherto separate domains now point at www.example.com , in .htaccess in root requests are rewritten to the resp. subdirectories (some domains are treated individually as domain/brand do not translate one to one, but the pattern is the same): www.example.com .htaccess RewriteCond %{HTTP_HOST} ^(www.)?(brand1|brand2|brand3).com$ [NC] RewriteRule ^ https://www.example.com/%2%{REQUEST_URI} [R=301,L] These directives are followed by a RewriteBase / di...