0

I have developed website in Drupal. There is folder(e.g., my-demo) which contains few PHP files which are developed in plain PHP. The my-demo directory is placed in the Drupal root directory.

Now I want to access this folder in a menu. If I put http://example.com/my-demo, it is accessible. I want the folder path to be like http://example.com/product-details/my-demo in the menu, without creating the product-details directory, because I have already mapped product-details to a path alias.

How can I achieve this?

2
  • what is your drupal version and what is your webserver?
    – Yuseferi
    Dec 28, 2016 at 6:17
  • @ zhilevan Drupal 7.5, Server is apache.
    – Nitin
    Dec 28, 2016 at 6:22

1 Answer 1

0

Yes you can do this with remapping in .htaccess

Find this code:

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

And add this line after it:

RewriteRule ^product-details/my-demo/(.*) my-demo/$1

So the complete version will be:

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^product-details/my-demo/(.*) my-demo/$1

See documentation for more examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.