开发者

Drupal as CMS / integration with existing website, menu path problems

开发者 https://www.devze.com 2023-02-06 23:18 出处:网络
I have website built on Zend Framework (which is not of much relevance with the problem) and Drupal installed in subfolder / drupal.

I have website built on Zend Framework (which is not of much relevance with the problem) and Drupal installed in subfolder / drupal.

In root of website I have following .htaccess

SetEnv APPLICATION_ENV development

RewriteEngine On

# this will be handled with Drupal
RewriteCond %{REQUEST_URI} ^/blog.*$  [OR]
RewriteCond %{REQUEST_URI} ^/financing.*$  [OR]
RewriteCond %{REQUEST_URI} ^/marketing.*$
RewriteRule (^.*$) /drupal/index.php?q=$1 [L]


# this is handled with Zend Framework
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCon开发者_如何转开发d %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

I have idea that goes like this: If someone access www.example.com/some-url then Zend Framework or static file will be handled, but when www.example.com/blog/some-blog-post, this will handled with drupal and for that part, everything is ok.

1) Problem with drupal links is that their absolute path is www.example.com/drupal/blog/some-blog-post (of course, alias to that post is blog/some-blog-post, but because drupal is installed in subfolder, it adds /drupal before blog/some-blog-post). Because of .htaccess rules that are in root folder of website, following url is also valid www.example.com/blog/some-blog-post. I want to somehow remove /drupal part from url. How can I accomplish this ?

2) How can I link to pages that are outside /drupal folder, with relative paths, for example /some-folder/some-page.html, and also root of website / ? I know that I can link them with absolute URL, like www.example.com/some-folder/some-page.html, but that is not good for me.


Drupal uses base_path() to get that path, you can influence that with the $base_url variable in settings.php, that file contains documentation about how to do that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号