By DMark78 on
I know, I know these questions have been asked before, but I just haven't gotten a response I can understand (sorry I am only a beginner). How do I set up Clean URLs? Please explain in simple language so I can understand each step. Thank you,
Comments
Follow the instructions
D6 makes this very easy for you; just go to Administer >> Site configuration >> Clean URLs and follow the instructions.
Clean URLs
Much improved in D6
ss
In the earlier versions you have to edit your .htaccess file which is in the root of your site
It was done by a professional for me and I can't remember exactly what he did but I think you'll find that if you replace the contents with the following it'll allow you to activate clean URLs
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
Order allow,deny
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
# PHP 4, Apache 2.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
# PHP 5, Apache 1 and 2.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
# Requires mod_expires to be enabled.
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
# Various rewrite rules.
RewriteEngine on
# If your site can be accessed both with and without the prefix www. you
# can use one of the following settings to force user to use only one option:
#
# If you want the site to be accessed WITH the www. only, adapt and
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule .* http://www.example.com/ [L,R=301]
#
# If you want the site to be accessed only WITHOUT the www. prefix, adapt
# and uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule .* http://example.com/ [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
#RewriteBase /drupal
# Added the following line to make this effective as far up the directory structure as possible, and to
# then hopefully propogate downwards through all paths 08 mar 07 (TH)
rewritebase /
# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]
# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
AddType x-mapp-php5 .php
# $Id: .htaccess,v 1.81 2007/01/09 09:27:10 dries Exp $
I must say I'm surprised that this isn't the default but I'm sure they have their reasons
Actually, with the exception
Actually, with the exception of this line:
AddType x-mapp-php5 .phpthere's nothing in your .htaccess that's not in the default D6.3 .htaccess. On the other hand, there are a number of additional lines in the default file that are missing in yours, most of which affect PHP. (You might want to look at updating yours -- that line above, which enabled PHP5 on your server, is probably what your programmer added.) The Clean URLs section is no different between the files.
Of course, DMark78 hasn't said where the hangup is with his installation. It could be an inability to write to .htaccess or several other things...
hi i am on win2003 do i need
hi i am on win2003
do i need this :
" AddModule mod_rewrite.c"
do i need this : " AddModule
Do you need that for what? Clean URLs? Doing a simple search yields a number of results for you. It looks like Clean URLs can't be run on a Windows server.