Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

redirect /app.php to prevent duplicate content #497

Merged
merged 3 commits into from
Feb 22, 2013
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion web/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# RewriteBase /
#</IfModule>

# redirect to URI without front controller to prevent duplicate content
RewriteRule ^app\.php(/(.*)|$) /$2 [R=301,END]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think (.*) is useless here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just kidding :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when $2 is undefined ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Params in subpattern are usually initialized emty. Anyway, I tested it and no problems encountered.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok then looks all good to me. Thanks.


# rewrite requests to non-existent files to front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
RewriteRule ^(.*)$ app.php [END]
</IfModule>