views:

392

answers:

2

Hi,

I'm trying to understand the following lines in joomla's .htaccess file. Can someone explain this please

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} !^/index.php
#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
#RewriteRule (.*) index.php
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

I want to do some custom redirects

for example if a url is like this example.com/subdirectory1 i want to redirect to some article. tried adding this line in the .htaccess file

RewriteRule ^somepath index.php?option=com_content&view=article&id=1&Itemid=12

but for some reason the article shows the title even though it's not supposed to show. when i access using the long url string the title doesn't appear if i rewrite it appears.

Please help.

-Vivek

A: 

Those lines are commented out with the # character at the beginning, so they do nothing. If uncommented, they send all requests for files that Apache can't find a real, physical file for to Joomla's index.php for further handling.

Not sure you mean about the "title" appearing. What title?

ceejayoz
sorry i commented it . it's supposed to be uncommented. and the title is the article title
Vivek Chandraprakash
What would the article title have to do with anything in `.htaccess`? Why shouldn't the title display?
ceejayoz
Vivek Chandraprakash
A RewriteRule will not change the HTML of the page. All it does is create, essentially, a URL alias for an existing path. If the page's title is disappearing/appearing on the page, something else odd is going on.
ceejayoz
A: 

The Page Title in Joomla should be controlled under the menu item. If you edit that menu item, there's a "System" tab on the right-hand side, and under there you can set the page title.

Mind, it'll change the minute you link off to a different article/image/video in that component. To get a good hold of page titles on your site, you might want to go to the Joomla Extension Directory and look for some of the plugins there which give you greater control over the page title.

Paul Sweeney