Jump to content

Problem with rewrite and alias


danbopes

Recommended Posts

This is the directory structure I have:

/var/www/demo1

/var/www/app

 

The document root for demo1.example.com goes to /var/www/demo1, (Virtual host), and I also have an Alias in demo1 (/app), to goto /var/www/app.

 

In my app folder, I have the following .htaccess file:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|user_guide|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

 

In essence /app/test, should redirect to /app/index.php/test. This is what I get tho:

 

404 Not Found:

/var/www/app/index.php/test

 

It does exist, but I think it's trying to tell the browser to go there, and it should be going to /app/index.php/test.

Link to comment
Share on other sites

The .htaccess in the previous step is incorrectly redirecting to /var/www/app/test.

What's that file look like?

 

And in the future, if you have a thread on a subject already then just keep using it until the problem is resolved. Don't need multiple threads for the same underlying problem.

Link to comment
Share on other sites

This is a different issue entirely, no longer is about multiple mod_rewrites, it's about mod_alias working together with mod_rewrite.

 

<VirtualHost *:80>

  ServerName demo1.example.com

  ServerAlias www.demo1.example.com

  DocumentRoot "/var/www/demo1"

  Alias /app "/var/www/app"

</VirtualHost>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.