Results 1 to 11 of 11
-
01-05-2009, 09:31 PM #1
- Join Date
- Apr 2008
- Location
- Boston, MA
- Posts
- 13,232
- Thanks
- 745
- Thanked 729 Times in 564 Posts
- Blog Entries
- 4
- Feedback Score
- 4 (100%)
Enable Url Rewriting on Apache Server 2.x
I was spending last two hours looking for an article to activate url rewriting (mod_rewrite) on Apache server. I am not a apache server guy, so all the articles were talking something that was going over my head.
Then I found this article showing a simple solution, Apache 2.2 and mod_rewrite Document As You Go
Wordpress hosted blogs seem to vanish often. Just for that , copying the article here but credit goes to that blog.
Code:This is a super short (and very rough) post on how to enable mod_rewrite in Apache 2.2. I have seen numerous posts on how to create “rewrite” scripts but found very little information on how to enable this feature in Apache 2.2. Step 1: Uncomment the line with “mod_rewrite.so” from httpd.conf
LoadModule rewrite_module modules/mod_rewrite.soStep 2: Search for the keyword “.htaccess” and change the AllowOverride valueAllowOverride AllStep 3: Restart Apache and check if module has been loaded (LoadedModule section in phpinfo()) Step 4: Create a test .htaccess in your root directoryOptions +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^success\.html$ index.php [L]Step 5: Type http://localhost/success.html in your browser (change port info based on your setup) You should be able to see your index.php load up.Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK
-
The Following User Says Thank You to manik For This Useful Post:
Anas (05-17-2010)
-
01-22-2009, 02:03 AM #2
i think now days control panels provide you options for enabling mod_rewrite and all u were needing it for local server ?
-
01-17-2010, 08:19 AM #3
-
05-17-2010, 03:46 AM #4
thakyou very much friend ... it really helped me a lot ... I was wondering why any .htaccess files are not working on my server at all. After going through these instructions, It started working well!!!!!
-
07-26-2010, 05:42 AM #5
Junior
- Join Date
- Mar 2010
- Posts
- 162
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
very useful, thanks for sharing.
-
07-28-2010, 08:05 PM #6
Freshman
- Join Date
- Jul 2010
- Posts
- 28
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
thanks for posting!
-
08-20-2010, 01:55 AM #7
Banned
- Join Date
- Feb 2010
- Posts
- 38
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
The following links also explain how we can setup mod_rewrite for URL Rewrting and can be used as reference for beginners.
http://www.webreference.com/programming/Mod_Rewrite/
http://www.tutorio.com/tutorial/enab...rite-on-apache
Some servers will not have the module enabled by default. As long as the module is enabled and present in the apache configuration file, you can enable it simply by starting a .htaccess file with the command
RewriteEngine on
Put this .htaccess file in your root so that rewriting is enabled throughout your site. You only need to write this line once per .htaccess file.
-
02-27-2011, 11:13 PM #8
Sophomore
- Join Date
- Feb 2011
- Posts
- 66
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Hi
How to write the url in apache because I have no idea about that?
-
05-15-2011, 06:59 PM #9
This kind of URL rewriting is normally used for redirecting old pages to new ones or domains without www to domains with www (or vice-versa). For example, if you wanted all requests to http://domain.com redirected to http://www.domain.com, you would put the following into .htaccess file and upload it to the root directory of your FTP Server:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
-
09-11-2011, 08:48 AM #10
Freshman
- Join Date
- Sep 2011
- Posts
- 14
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
If you installed Appserve on your PC !
view fllowing : C:\AppServ\Apache2.2\conf
And open file http.conf with notepad
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
And modify to
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
a
nd save reastart apche ! and run localhost to test !
You can using URL friendly on your local server !
-
09-26-2011, 07:42 AM #11
Freshman
- Join Date
- Sep 2011
- Posts
- 1
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Depending on the software your server is running, you may already have access to URL rewriting modules. If not, most hosts will enable or install the relevant modules for you if you ask them very nicely.
Apache is the easiest system to get URL rewriting running on. It usually comes with its own built-in URL rewriting module, mod_rewrite, enabled, and working with mod_rewrite is as simple as uploading correctly formatted and named text files.
Similar Threads
-
What is Apache?
By antonclovelly in forum Web Development - Programming & CodingReplies: 0Last Post: 05-17-2010, 06:29 AM -
URL rewriting..apache server..
By seoladder in forum PHPReplies: 2Last Post: 05-15-2010, 12:02 AM -
How to link MySQL database to .cfm page on a hosting server
By Abina in forum ColdFusionReplies: 1Last Post: 02-02-2010, 11:18 AM -
Please, I need advice on which Server to get for work
By bluewhale in forum Windows ServerReplies: 0Last Post: 01-06-2010, 10:27 AM -
Windows Server 2008 Delivers Web-based Experiences
By shovakoirala in forum Windows ServerReplies: 7Last Post: 12-11-2009, 05:49 PM



Reply With Quote


