It's not easy to tune a rewrite.

Source: Internet
Author: User

Background

In recent days to do a small project, using a domestic platform for version control, project demonstration, quality management. Due to the use of the Laravel framework, the project portal under the public directory, the demo platform does not provide the ability to modify the root directory of the Web site permissions. So can you get it through rewrite?

Groping

Degrees Niang not to force, half a day did not find the rules can be used. Then can only write their own, I write rewrite is a dabbler, try for a long time or not fix, the main reason is no effective way to debug, only blind blindfolded ...
Later asked degrees Niang how to open Apache rewrite log, most of this:

RewriteLog "/myfolder/mylogfile.log"   RewriteLogLevel 9

Apache can't get up, look at the log is like this

Syntax error on line 162 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:Invalid command ‘RewriteLog‘, perhaps misspelled or defined by a module not included in the server configuration

You can't calm down, go through the manual, http://httpd.apache.org/docs/current/mod/mod_rewrite.html.

The original is set: LogLevel rewrite:trace3, log to see errorlog point to the file.

<VirtualHost *:80>    ServerAdmin [email protected]    DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host.example.com"    ServerName dummy-host.example.com    ServerAlias www.dummy-host.example.com    LogLevel rewrite:trace3    ErrorLog "logs/dummy-host.example.com-error_log"    CustomLog "logs/dummy-host.example.com-access_log" common</VirtualHost>

The log is this:

[Wed Apr 22 19:40:30.641932 2015] [rewrite:trace3] [pid 5718] mod_rewrite.c(475): [client 127.0.0.1:50136] 127.0.0.1 - - [test.me/sid#10085e000][rid#1008c9260/initial/redir#1] [perdir /Users/MLS/mineObj/hellolumen/] strip per-dir prefix: /Users/MLS/mineObj/hellolumen/index.php -> index.php[Wed Apr 22 19:40:30.641956 2015] [rewrite:trace3] [pid 5718] mod_rewrite.c(475): [client 127.0.0.1:50136] 127.0.0.1 - - [test.me/sid#10085e000][rid#1008c9260/initial/redir#1] [perdir /Users/MLS/mineObj/hellolumen/] applying pattern ‘^(.*)/$‘ to uri ‘index.php‘[Wed Apr 22 19:40:30.641969 2015] [rewrite:trace3] [pid 5718] mod_rewrite.c(475): [client 127.0.0.1:50136] 127.0.0.1 - - [test.me/sid#10085e000][rid#1008c9260/initial/redir#1] [perdir /Users/MLS/mineObj/hellolumen/] strip per-dir prefix: /Users/MLS/mineObj/hellolumen/index.php -> index.php

Ok! With the diary is good to do, then slowly adjust.

Solutions

I believe it is possible to solve the problem of laravel deploying to the non-public environment in the portal through rewrite.
Time is not early, first go home to eat, wait for the result and then paste it over. Welcome to understand the friend feedback

It's not easy to tune a rewrite.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.