Eli
Eli

Reputation: 99

How can I rewrite index.php to xxx.php?

I want the following two routes to be set in this way:

Currently what I have in .htaccess is

RewriteRule ^$ app\.php [L]
RewriteRule post/(.*)$ app\.php [L]

How can I achieve route 2?

Upvotes: 1

Views: 435

Answers (1)

anubhava
anubhava

Reputation: 785098

Try this in one rule:

RewriteEngine On

RewriteRule ^(post/.+)?$ app.php [L,NC]

Upvotes: 1

Related Questions