A
A
Alexander Semikashev2014-01-24 20:01:53
Apache HTTP Server
Alexander Semikashev, 2014-01-24 20:01:53

CNC htaccess shorthand?

In general, there are such lines (there are 10 such pieces):

RewriteRule ^news/$ news/news.php [L]
RewriteRule ^label/$ label/label.php [L]
RewriteRule ^page/$ /page/page.php [L]

Is it possible to shorten them, something like this:
RewriteRule ^(news|label|page)/$ (news|label|page)/(news|label|page).php [L]

How to do it right? And does it make sense?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toxa82, 2014-01-24
@toxa82

RewriteRule ^(.*?)/$ /$1/$1.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question